added more keybinds and some lsp config

main
spinach 2 years ago
parent bd0bcf5323
commit bbc6a91e8f

@ -48,8 +48,24 @@ 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 = {
@ -60,9 +76,18 @@ lspconfig.lua_ls.setup{
},
},
}
-- 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)

Loading…
Cancel
Save