refactor: configure LSP in ~/.config/nvim/lua/lsp

-> moved from ~/.config/nvim/
.../nvim/lua/lsp/init.lua now has a setup() function

!!! nvim-lspconfig is now lazy-loaded
-> packer checks filetype (see .../nvim/plugins.lua)
This commit is contained in:
David JULIEN 2021-07-22 23:03:21 +02:00
parent e159cad0ec
commit 2b9ba03eaf
No known key found for this signature in database
GPG Key ID: 4B388E8BD9D47382
3 changed files with 16 additions and 8 deletions

View File

@ -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

View File

@ -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) -- ./<ft>.lua
end
return lsp

View File

@ -39,7 +39,12 @@ return require("packer").startup(function()
}
-- LSP
use "neovim/nvim-lspconfig"
use {
"neovim/nvim-lspconfig",
opt = true,
ft = { "c", "cpp", "lua", "python", "tex"},
config = function() require("lsp").setup() end
}
-- auto completion
use "hrsh7th/nvim-compe"