neovim: minor improvement in lspconfig

This commit is contained in:
FollieHiyuki 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

View File

@ -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'
} }