diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d913130..9199b9d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -12,13 +12,6 @@ require("statusline") -- ./lua/statusline.lua require("polyjuice") -- ~/.local/src/polyjuice/lua/polyjuice.lua --- LSP -require("lsp") -- ./lua/lsp/init.lua -require("lsp.c") -- ./lua/lsp/c.lua -require("lsp.lua") -- ./lua/lsp/lua.lua -require("lsp.python") -- ./lua/lsp/python.lua -require("lsp.tex") -- ./lua/lsp/python.lua - -- auto complete require("plugin.compe") -- ./lua/plugin/compe.lua diff --git a/.config/nvim/lua/lsp/init.lua b/.config/nvim/lua/lsp/init.lua index 32d39a7..c7e5d03 100644 --- a/.config/nvim/lua/lsp/init.lua +++ b/.config/nvim/lua/lsp/init.lua @@ -3,6 +3,8 @@ -- License : GPLv3 -- Description : neovim lsp config file +local lsp = {} + vim.fn.sign_define( "LspDiagnosticsSignError", { @@ -63,3 +65,11 @@ vim.lsp.protocol.CompletionItemKind = { "  ", -- Operator "  ", -- TypeParameter } + +function lsp.setup() + local ft = vim.bo.filetype + if ft == "cpp" then ft = "c" end + require("lsp." .. ft) -- ./.lua +end + +return lsp diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index e1a02d4..87c2352 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -34,12 +34,15 @@ return require("packer").startup(function() use { "nvim-telescope/telescope.nvim", requires = { "nvim-lua/popup.nvim", "nvim-lua/plenary.nvim"}, - opt = true, - cmd = {"Telescope"} + cmd = "Telescope" } -- LSP - use "neovim/nvim-lspconfig" + use { + "neovim/nvim-lspconfig", + ft = { "c", "cpp", "lua", "python", "tex"}, + config = function() require("lsp").setup() end + } -- auto completion use "hrsh7th/nvim-compe" @@ -47,8 +50,7 @@ return require("packer").startup(function() -- display colors directly in editor use { "norcalli/nvim-colorizer.lua", - opt = true, - cmd = {"ColorizerToggle"} + cmd = "ColorizerToggle" } end) diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 18eefbf..0740eae 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -19,6 +19,7 @@ opt.wildoptions = "pum" g.loaded_netrw = 1 -- disable netrw -- editor +opt.lazyredraw = true opt.splitright = true opt.splitbelow = true opt.scrolloff = 4 diff --git a/.local/share/nvim/lsp/sumneko_lua b/.local/share/nvim/lsp/sumneko_lua index 9889dc0..8bd3d09 160000 --- a/.local/share/nvim/lsp/sumneko_lua +++ b/.local/share/nvim/lsp/sumneko_lua @@ -1 +1 @@ -Subproject commit 9889dc0d1c9673575ebbfa62f3d47d59d0ff8664 +Subproject commit 8bd3d0987af29c71f5e6bfa884936dc99aa58293