feat: lsp bindings
This commit is contained in:
parent
78f6db3126
commit
fced53c135
@ -1,5 +1,7 @@
|
||||
-- packages
|
||||
require'lspconfig'.dockerls.setup {}
|
||||
require'lspconfig'.dockerls.setup {
|
||||
on_attach = require'lspbinds',
|
||||
}
|
||||
|
||||
-- variables
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
-- packages
|
||||
require'lspconfig'.pyright.setup {}
|
||||
require'lspconfig'.pyright.setup {
|
||||
on_attach = require'lspbinds',
|
||||
}
|
||||
|
||||
-- variables
|
||||
vim.cmd("let g:black_linelength=79")
|
||||
|
@ -1,5 +1,7 @@
|
||||
-- packages
|
||||
require'lspconfig'.bashls.setup{}
|
||||
require'lspconfig'.bashls.setup{
|
||||
on_attach = require'lspbinds',
|
||||
}
|
||||
|
||||
-- variables
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
-- packages
|
||||
require'lspconfig'.yamlls.setup {}
|
||||
require'lspconfig'.yamlls.setup {
|
||||
on_attach = require'lspbinds',
|
||||
}
|
||||
|
||||
-- variables
|
||||
vim.o.shiftwidth = 2
|
||||
|
@ -43,5 +43,3 @@ vim.keymap.set("n", "<C-k>", "<C-w>k" )
|
||||
vim.keymap.set("n", "<C-l>", "<C-w>l" )
|
||||
|
||||
vim.keymap.set("n", "gf", "gF" )
|
||||
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
|
@ -6,9 +6,7 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
return function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
@ -31,24 +29,3 @@ local on_attach = function(client, bufnr)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
|
||||
end
|
||||
|
||||
local lsp_flags = {
|
||||
-- This is the default in Nvim 0.7+
|
||||
debounce_text_changes = 150,
|
||||
}
|
||||
require('lspconfig')['pyright'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}
|
||||
require('lspconfig')['tsserver'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}
|
||||
require('lspconfig')['rust_analyzer'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
-- Server-specific settings...
|
||||
settings = {
|
||||
["rust-analyzer"] = {}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user