diff --git a/ftplugin/c.lua b/ftplugin/c.lua new file mode 100644 index 0000000..46c2eb4 --- /dev/null +++ b/ftplugin/c.lua @@ -0,0 +1,10 @@ +vim.g.cino = "N-s" +vim.o.textwidth = 80 + +vim.g.cpp_attributes_highlight = true +vim.g.cpp_member_highlight = true +vim.g.cpp_simple_highlight = true + +-- remove white spaces at end of line +vim.api.nvim_create_autocmd({'BufWritePre'}, {command = '%s;\\s\\+$;;e'}) + diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua new file mode 100644 index 0000000..7e38e3f --- /dev/null +++ b/ftplugin/lua.lua @@ -0,0 +1,5 @@ +vim.o.textwidth = 100 + +-- remove white spaces at end of line +vim.api.nvim_create_autocmd({'BufWritePre'}, {command = '%s;\\s\\+$;;e'}) + diff --git a/ftplugin/rust.lua b/ftplugin/rust.lua new file mode 100644 index 0000000..7e38e3f --- /dev/null +++ b/ftplugin/rust.lua @@ -0,0 +1,5 @@ +vim.o.textwidth = 100 + +-- remove white spaces at end of line +vim.api.nvim_create_autocmd({'BufWritePre'}, {command = '%s;\\s\\+$;;e'}) + diff --git a/init.lua b/init.lua index 52d1e01..e4407cf 100644 --- a/init.lua +++ b/init.lua @@ -1,10 +1,11 @@ -- Set global configuration vim.g.mapleader = "," vim.o.number = true +vim.o.colorcolumn = '+1' -- Set indentation options vim.o.tabstop = 4 -vim.o.shiftwidth = 4 +vim.o.shiftwidth = 4 vim.o.expandtab = true -- Disable unused providers diff --git a/lua/plugins.lua b/lua/plugins.lua index 8b93d7f..b1424cb 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -41,7 +41,7 @@ local function manage_plugins() vim.cmd("colorscheme nightfox") end }, - + -- COQ ["https://github.com/ms-jpq/coq_nvim.git"] = {}, ["https://github.com/ms-jpq/coq.artifacts.git"] = { @@ -60,10 +60,10 @@ local function manage_plugins() server = { on_attach = function(_, bufnr) -- Hover actions - vim.keymap.set("n", "", + vim.keymap.set("n", "", rt.hover_actions.hover_actions, { buffer = bufnr }) -- Code action groups - vim.keymap.set("n", "a", + vim.keymap.set("n", "a", rt.code_action_group.code_action_group, { buffer = bufnr }) end, }, @@ -80,24 +80,27 @@ local function manage_plugins() vim.cmd('set signcolumn=number') end }, + + -- Syntax highlight + ["https://github.com/bfrg/vim-cpp-modern.git"] = {}, } local manager = require("plogins").manage(plugins) - vim.api.nvim_create_user_command("PloginsUpgrade", + vim.api.nvim_create_user_command("PloginsUpgrade", manager.upgrade, {}) - vim.api.nvim_create_user_command("PloginsAutoremove", + vim.api.nvim_create_user_command("PloginsAutoremove", manager.autoremove, {}) end local plogins_source = "https://github.com/faerryn/plogins.nvim.git" local plogins_name = plogins_source:gsub("/", "%%") -local plogins_dir = ("%s/site/pack/plogins/opt/%s"):format((vim.fn.stdpath("data")), +local plogins_dir = ("%s/site/pack/plogins/opt/%s"):format((vim.fn.stdpath("data")), plogins_name) if not vim.loop.fs_stat(plogins_dir) then - vim.loop.spawn("git", - { args = { "clone", "--depth", "1", plogins_source, plogins_dir } }, + vim.loop.spawn("git", + { args = { "clone", "--depth", "1", plogins_source, plogins_dir } }, function(code, signal) vim.defer_fn(function() vim.cmd(("packadd %s"):format(vim.fn.fnameescape(plogins_name)))