From 203930c326ba04ff41df30328eefeb6dcc878abd Mon Sep 17 00:00:00 2001 From: vired <62380689+vired@users.noreply.github.com> Date: Mon, 13 Apr 2020 17:09:32 +0600 Subject: [PATCH] autocmd to delete newlines at end of file on save. (#563) --- .config/nvim/init.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 5b1605d..c0078e1 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -103,8 +103,9 @@ set clipboard+=unnamedplus autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x! autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q! -" Automatically deletes all trailing whitespace on save. +" Automatically deletes all trailing whitespace and newlines at end of file on save. autocmd BufWritePre * %s/\s\+$//e + autocmd BufWritepre * %s/\n\+\%$//e " When shortcut files are updated, renew bash and ranger configs with new material: autocmd BufWritePost files,directories !shortcuts