From 46e44234a462a602626ff888d94de518cd55f964 Mon Sep 17 00:00:00 2001 From: Waldir Borba Junior Date: Mon, 6 Jun 2022 18:08:19 -0300 Subject: [PATCH] Update init.lua feat: remove white space on save files --- lua/core/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/core/init.lua b/lua/core/init.lua index a4cc556..a5d6da8 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -23,5 +23,11 @@ autocmd('BufEnter', { command = 'set fo-=c fo-=r fo-=o' }) +-- Remove whitespace on save +autocmd('BufWritePre', { + pattern = '*', + command = ":%s/\\s\\+$//e" +}) + -- load statusline vim.opt.statusline = "%!v:lua.require'ui.statusline'.run()"