cleanup and refactor autocmd

This commit is contained in:
2024-12-18 11:02:05 +02:00
parent 0334178b6e
commit 68ea39094c
2 changed files with 4 additions and 4 deletions

View File

@@ -18,12 +18,12 @@ autocmd('LspAttach', {
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<M-F>", "<cmd>lua vim.lsp.buf.format()<CR>")
vim.keymap.set("n", "<M-F>", function() vim.lsp.buf.format() end, opts)
end
})
-- Add new line to the end of the file
autocmd({ "BufWritePre" }, {
autocmd({ 'BufWritePre' }, {
group = OnSaveGroup,
pattern = '*',
callback = function()
@@ -37,7 +37,7 @@ autocmd({ "BufWritePre" }, {
})
-- Remove trailing spaces
autocmd({ "BufWritePre" }, {
autocmd({ 'BufWritePre' }, {
group = OnSaveGroup,
pattern = { "*" },
callback = function()