mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 23:17:35 +00:00
Update bindings for formatting and range formatting with an lsp prefix (l)
This commit is contained in:
parent
1eee1c727f
commit
7b3f69cf66
@ -81,7 +81,7 @@ local function default_attach(client, bufnr)
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
buf_set_keymap("n", "<leader>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>lf", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
vim.cmd([[
|
||||
augroup lsp_format
|
||||
autocmd!
|
||||
@ -89,8 +89,9 @@ local function default_attach(client, bufnr)
|
||||
" autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync(nil, 1000)
|
||||
augroup END
|
||||
]])
|
||||
elseif client.resolved_capabilities.document_range_formatting then
|
||||
buf_set_keymap("n", "<leader>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
|
||||
end
|
||||
if client.resolved_capabilities.document_range_formatting then
|
||||
buf_set_keymap("n", "<leader>lfr", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
|
||||
end
|
||||
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
|
Loading…
Reference in New Issue
Block a user