nvim: use <leader>cf for code formatting

This commit is contained in:
Daniel Lundin 2024-11-06 00:40:41 +01:00
parent aa228521fe
commit 93f6d76c76
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI

View file

@ -35,7 +35,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
vim.keymap.set("n", "<space>r", vim.lsp.buf.rename, opts("Rename Symbol"))
vim.keymap.set({ "n", "v" }, "<space>a", vim.lsp.buf.code_action, opts("Code Action"))
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts("Buffer References"))
vim.keymap.set("n", "<localleader>f", function()
vim.keymap.set("n", "<space>cf", function()
vim.lsp.buf.format({ async = true })
end, opts("Format Buffer"))
end,