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:
parent
e159cad0ec
commit
2b9ba03eaf
@ -12,13 +12,6 @@ require("statusline") -- ./lua/statusline.lua
|
|||||||
|
|
||||||
require("polyjuice") -- ~/.local/src/polyjuice/lua/polyjuice.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
|
-- auto complete
|
||||||
require("plugin.compe") -- ./lua/plugin/compe.lua
|
require("plugin.compe") -- ./lua/plugin/compe.lua
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
-- License : GPLv3
|
-- License : GPLv3
|
||||||
-- Description : neovim lsp config file
|
-- Description : neovim lsp config file
|
||||||
|
|
||||||
|
local lsp = {}
|
||||||
|
|
||||||
vim.fn.sign_define(
|
vim.fn.sign_define(
|
||||||
"LspDiagnosticsSignError",
|
"LspDiagnosticsSignError",
|
||||||
{
|
{
|
||||||
@ -63,3 +65,11 @@ vim.lsp.protocol.CompletionItemKind = {
|
|||||||
" ", -- Operator
|
" ", -- Operator
|
||||||
" ", -- TypeParameter
|
" ", -- TypeParameter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lsp.setup()
|
||||||
|
local ft = vim.bo.filetype
|
||||||
|
if ft == "cpp" then ft = "c" end
|
||||||
|
require("lsp." .. ft) -- ./<ft>.lua
|
||||||
|
end
|
||||||
|
|
||||||
|
return lsp
|
||||||
|
@ -39,7 +39,12 @@ return require("packer").startup(function()
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- LSP
|
-- 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
|
-- auto completion
|
||||||
use "hrsh7th/nvim-compe"
|
use "hrsh7th/nvim-compe"
|
||||||
|
Reference in New Issue
Block a user