Add LSP keymap to format current buffer in

This commit is contained in:
Gabriel Crispino 2024-03-31 04:38:34 +01:00 committed by GitHub
parent 93fde0556e
commit 459fe1cd90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -501,6 +501,11 @@ require('lazy').setup({
-- For example, in C this would take you to the header.
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
-- Formats the current buffer
map('<space>f', function()
vim.lsp.buf.format { async = true }
end, '[F]ormat code')
-- The following two autocommands are used to highlight references of the
-- word under your cursor when your cursor rests there for a little while.
-- See `:help CursorHold` for information about when this is executed