neovim: minor improvement in lspconfig

This commit is contained in:
Hoang Nguyen 2021-07-12 12:26:16 +03:00
parent 5ab3184378
commit 2dbf4079a5
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
1 changed files with 3 additions and 1 deletions

View File

@ -27,7 +27,7 @@ local on_attach = function(client, bufnr)
if client.resolved_capabilities.document_formatting then
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.formatting()<CR>', opts)
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
@ -63,6 +63,7 @@ table.insert(runtime_path, 'lua/?/init.lua')
lspconf.sumneko_lua.setup {
on_attach = on_attach,
capabilities = capabilities,
cmd = {
vim.fn.stdpath('data') .. '/lsp/lua-language-server/bin/Linux/lua-language-server',
'-E',
@ -107,6 +108,7 @@ local servers = {
'pyright',
'tsserver',
'html',
'jsonls',
'cmake',
'rust_analyzer'
}