|
|
|
@ -48,21 +48,46 @@ vim.cmd([[
|
|
|
|
|
-- language server setup
|
|
|
|
|
local lspconfig = require('lspconfig')
|
|
|
|
|
|
|
|
|
|
lspconfig.gopls.setup{}
|
|
|
|
|
-- Go
|
|
|
|
|
lspconfig.gopls.setup{
|
|
|
|
|
cmd = {"gopls", "server"},
|
|
|
|
|
filetypes = {"go", "gomod"},
|
|
|
|
|
settings = {
|
|
|
|
|
gopls = {
|
|
|
|
|
analyses = {
|
|
|
|
|
unusedparams = true,
|
|
|
|
|
},
|
|
|
|
|
staticcheck = true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- C/C++
|
|
|
|
|
lspconfig.clangd.setup{}
|
|
|
|
|
|
|
|
|
|
-- Lua
|
|
|
|
|
lspconfig.lua_ls.setup{
|
|
|
|
|
settings = {
|
|
|
|
|
Lua = {
|
|
|
|
|
diagnostics = { globals = { 'vim' } },
|
|
|
|
|
diagnostics = {globals = {'vim'}},
|
|
|
|
|
},
|
|
|
|
|
telemetry = {
|
|
|
|
|
enable = false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- Rust
|
|
|
|
|
lspconfig.rust_analyzer.setup{}
|
|
|
|
|
|
|
|
|
|
-- Python
|
|
|
|
|
lspconfig.pylsp.setup{}
|
|
|
|
|
|
|
|
|
|
-- TypeScript
|
|
|
|
|
lspconfig.tsserver.setup{}
|
|
|
|
|
|
|
|
|
|
-- lsp mappingsd
|
|
|
|
|
vim.keymap.set('n', '<leader>gD', vim.lsp.buf.declaration, opts)
|
|
|
|
|
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition, opts)
|
|
|
|
|
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
|
|
|
|
|
vim.keymap.set('n', '<leader>H', vim.lsp.buf.hover, opts)
|
|
|
|
|