Files
dotfiles/nvim/lua/whitespace.lua
Nick Mello 65d08b0772 all: Initial dotfiles
Import an initial copy of all of my dotfiles

Signed-off-by: Nicholas Mello <nick@nmello.dev>
2025-08-14 19:21:24 -05:00

13 lines
407 B
Lua

-- RemoveWhitespace
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("RemoveWhitespace", { clear = true }),
pattern = "*", -- Handle pattern myself in callback
callback = function()
if vim.bo.filetype == "diff" then
return
end
-- Failure to find is not a real failure, silence failures
vim.api.nvim_command("silent! " .. "%s/\\s\\+$//")
end,
})