diff --git a/neovim/lua/plugins/lsp.lua b/neovim/lua/plugins/lsp.lua index efa643f..f3436e9 100644 --- a/neovim/lua/plugins/lsp.lua +++ b/neovim/lua/plugins/lsp.lua @@ -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", "f", "lua vim.lsp.buf.formatting()", opts) + buf_set_keymap("n", "lf", "lua vim.lsp.buf.formatting()", opts) vim.cmd([[ augroup lsp_format autocmd! @@ -89,8 +89,9 @@ local function default_attach(client, bufnr) " autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 1000) augroup END ]]) - elseif client.resolved_capabilities.document_range_formatting then - buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) + end + if client.resolved_capabilities.document_range_formatting then + buf_set_keymap("n", "lfr", "lua vim.lsp.buf.range_formatting()", opts) end -- Set autocommands conditional on server_capabilities