Browse code

vimrc - v1.2 - Remove trailing whitespace

Fred authored on07/08/2024 16:58:17
Showing1 changed files
... ...
@@ -1,6 +1,7 @@
1 1
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2 2
 " Versions
3 3
 "
4
+" v1.2 - 2024-08-07: remove trailing whitespace
4 5
 " v1.1 - 2020-08-16: status line improved / comment symbol for R filetype added / comment shortcut improved / replacement shortcut improved / tabedit shortcut improved
5 6
 " v1.0 - 2020-03-15: backup, undo and swap improved / text duplication mapping / search and replace mapping / plugins added / code cleaned
6 7
 " v0.4 - 2019-11-20: backup, undo and swap added
... ...
@@ -259,6 +260,10 @@ set wrap "Wrap lines
259 260
 " Comment symbol for filetype
260 261
 autocmd FileType r setlocal commentstring=#\ %s
261 262
 
263
+" Remove trailing whitespace
264
+" Note: use *.{sh,R,etc} to restrict filetype
265
+autocmd BufWritePre * :%s/\s\+$//e
266
+
262 267
 
263 268
 """"""""""""""""""""""""""""""
264 269
 " => Visual mode related