From bdfc00159bf92b432ea8f737daebdb667bce7ad0 Mon Sep 17 00:00:00 2001 From: Daniel Weber Date: Fri, 14 Jun 2024 15:06:18 -0400 Subject: [PATCH] Add autocmd to remove trailing white spaces --- lua/pippy/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/pippy/init.lua b/lua/pippy/init.lua index 259a9c4..f9c52ac 100644 --- a/lua/pippy/init.lua +++ b/lua/pippy/init.lua @@ -30,3 +30,8 @@ vim.opt.list = true vim.opt.spelllang = 'en_us' vim.opt.spell = true + +vim.api.nvim_create_autocmd({ "BufWritePre" }, { + pattern = { "*" }, + command = [[%s/\s\+$//e]], +})