mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-12-01 03:38:32 -05:00
neovim: minor improvement in lspconfig
This commit is contained in:
parent
5ab3184378
commit
2dbf4079a5
@ -27,7 +27,7 @@ local on_attach = function(client, bufnr)
|
|||||||
if client.resolved_capabilities.document_formatting then
|
if client.resolved_capabilities.document_formatting then
|
||||||
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||||
elseif client.resolved_capabilities.document_range_formatting then
|
elseif client.resolved_capabilities.document_range_formatting then
|
||||||
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.range_formatting()<CR>', opts)
|
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0})<CR>', opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -63,6 +63,7 @@ table.insert(runtime_path, 'lua/?/init.lua')
|
|||||||
|
|
||||||
lspconf.sumneko_lua.setup {
|
lspconf.sumneko_lua.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
cmd = {
|
cmd = {
|
||||||
vim.fn.stdpath('data') .. '/lsp/lua-language-server/bin/Linux/lua-language-server',
|
vim.fn.stdpath('data') .. '/lsp/lua-language-server/bin/Linux/lua-language-server',
|
||||||
'-E',
|
'-E',
|
||||||
@ -107,6 +108,7 @@ local servers = {
|
|||||||
'pyright',
|
'pyright',
|
||||||
'tsserver',
|
'tsserver',
|
||||||
'html',
|
'html',
|
||||||
|
'jsonls',
|
||||||
'cmake',
|
'cmake',
|
||||||
'rust_analyzer'
|
'rust_analyzer'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user