|
|
@ -48,21 +48,46 @@ vim.cmd([[
|
|
|
|
-- language server setup
|
|
|
|
-- language server setup
|
|
|
|
local lspconfig = require('lspconfig')
|
|
|
|
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{}
|
|
|
|
lspconfig.clangd.setup{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Lua
|
|
|
|
lspconfig.lua_ls.setup{
|
|
|
|
lspconfig.lua_ls.setup{
|
|
|
|
settings = {
|
|
|
|
settings = {
|
|
|
|
Lua = {
|
|
|
|
Lua = {
|
|
|
|
diagnostics = { globals = { 'vim' } },
|
|
|
|
diagnostics = {globals = {'vim'}},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
telemetry = {
|
|
|
|
telemetry = {
|
|
|
|
enable = false,
|
|
|
|
enable = false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Rust
|
|
|
|
lspconfig.rust_analyzer.setup{}
|
|
|
|
lspconfig.rust_analyzer.setup{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Python
|
|
|
|
lspconfig.pylsp.setup{}
|
|
|
|
lspconfig.pylsp.setup{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- TypeScript
|
|
|
|
|
|
|
|
lspconfig.tsserver.setup{}
|
|
|
|
|
|
|
|
|
|
|
|
-- lsp mappingsd
|
|
|
|
-- lsp mappingsd
|
|
|
|
vim.keymap.set('n', '<leader>gD', vim.lsp.buf.declaration, opts)
|
|
|
|
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>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)
|
|
|
|