1
0
Fork 0

nvim: add autocmd to remove trailing spaces, it is ugly

This commit is contained in:
Pratham Patel 2024-03-19 17:10:40 +05:30
parent 6223a324f1
commit 1808edb36f
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
1 changed files with 6 additions and 0 deletions

View File

@ -16,3 +16,9 @@ vim.api.nvim_create_autocmd('BufWritePre', {
pattern = {'*.rs'},
command = 'lua vim.lsp.buf.format(nil, 200)',
})
-- thank you, Prime
-- https://github.com/ThePrimeagen/neovimrc/blob/4d7a467091706a75684ee9a32b1e1e8f2e187e39/lua/theprimeagen/init.lua#L44-L48
vim.api.nvim_create_autocmd('BufWritePre', {
pattern = "*",
command = [[%s/\s\+$//e]],
})