Neovim: Remove trailing whitespace on save

This commit is contained in:
Tony Grosinger 2024-06-04 20:52:17 -07:00
parent 2f346e9396
commit 17232fd215

View File

@ -177,6 +177,12 @@ vim.api.nvim_create_autocmd('TextYankPost', {
end,
})
-- Trim trailing whitespace on save.
vim.api.nvim_create_autocmd({ 'BufWritePre' }, {
pattern = { '*' },
command = [[%s/\s\+$//e]],
})
-- [[ Install `lazy.nvim` plugin manager ]]
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'