autocmd to delete newlines at end of file on save. (#563)
This commit is contained in:
parent
64b8f08563
commit
203930c326
1 changed files with 2 additions and 1 deletions
|
@ -103,8 +103,9 @@ set clipboard+=unnamedplus
|
||||||
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
|
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
|
||||||
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
|
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
|
||||||
|
|
||||||
" 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/\s\+$//e
|
||||||
|
autocmd BufWritepre * %s/\n\+\%$//e
|
||||||
|
|
||||||
" When shortcut files are updated, renew bash and ranger configs with new material:
|
" When shortcut files are updated, renew bash and ranger configs with new material:
|
||||||
autocmd BufWritePost files,directories !shortcuts
|
autocmd BufWritePost files,directories !shortcuts
|
||||||
|
|
Loading…
Reference in a new issue