|
|
@ -149,6 +149,22 @@ local on_attach = function(client, bufnr) |
|
|
|
'<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', |
|
|
|
opts |
|
|
|
) |
|
|
|
-- Set some keybinds conditional on server capabilities |
|
|
|
if client.resolved_capabilities.document_formatting then |
|
|
|
Map( |
|
|
|
'n', |
|
|
|
'<space>f', |
|
|
|
'<cmd>lua vim.lsp.buf.formatting()<CR>', |
|
|
|
opts |
|
|
|
) |
|
|
|
elseif client.resolved_capabilities.document_range_formatting then |
|
|
|
Map( |
|
|
|
'n', |
|
|
|
'<space>f', |
|
|
|
'<cmd>lua vim.lsp.buf.range_formatting()<CR>', |
|
|
|
opts |
|
|
|
) |
|
|
|
end |
|
|
|
-- Set autocommands conditional on server_capabilities |
|
|
|
if client.resolved_capabilities.document_highlight then |
|
|
|
Api.nvim_exec( |
|
|
|