Compare commits
4 Commits
da7d23f17e
...
f0c20713d1
Author | SHA1 | Date | |
---|---|---|---|
|
f0c20713d1 | ||
|
09b415812d | ||
|
04234e57b1 | ||
|
0aaac9f627 |
@ -178,12 +178,19 @@ local on_attach = function(client, bufnr)
|
|||||||
--vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
--vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- LSP settings (for overriding per client)
|
||||||
|
local handlers = {
|
||||||
|
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {border = border}),
|
||||||
|
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = border }),
|
||||||
|
}
|
||||||
|
|
||||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||||
-- map buffer local keybindings when the language server attaches
|
-- map buffer local keybindings when the language server attaches
|
||||||
local servers = { 'pyright', 'bashls', 'ansiblels' }
|
local servers = { 'pyright', 'bashls', 'ansiblels' }
|
||||||
for _, lsp in pairs(servers) do
|
for _, lsp in pairs(servers) do
|
||||||
require('lspconfig')[lsp].setup {
|
require('lspconfig')[lsp].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
handlers=handlers,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
flags = {
|
flags = {
|
||||||
debounce_text_changes = 150,
|
debounce_text_changes = 150,
|
||||||
@ -191,6 +198,12 @@ for _, lsp in pairs(servers) do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Handlers when you are in the insert mode you see the errors
|
||||||
|
vim.lsp.handlers["textDocument/publishDiagnostics"] =
|
||||||
|
vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics,
|
||||||
|
{update_in_insert = true})
|
||||||
|
|
||||||
|
-- Setup a yamlls plugin
|
||||||
require'lspconfig'.yamlls.setup{
|
require'lspconfig'.yamlls.setup{
|
||||||
settings = {
|
settings = {
|
||||||
json = {
|
json = {
|
||||||
@ -269,8 +282,13 @@ cmp.setup.cmdline('/', {
|
|||||||
{ name = 'buffer' }
|
{ name = 'buffer' }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
" Added popout window to see diagnostic
|
||||||
|
set updatetime=250
|
||||||
|
autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})
|
||||||
|
|
||||||
" Neoformat
|
" Neoformat
|
||||||
let g:neoformat_try_formatprg = 1
|
let g:neoformat_try_formatprg = 1
|
||||||
let g:neoformat_basic_format_trim = 1
|
let g:neoformat_basic_format_trim = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user