diff options
author | Cody Hiar <cody@hiar.ca> | 2021-03-09 10:50:36 -0700 |
---|---|---|
committer | Cody Hiar <cody@hiar.ca> | 2021-03-09 10:50:51 -0700 |
commit | 92d08970c2e09c6799cf2c9a03f982a23c950a89 (patch) | |
tree | d217a7e0a46089dbf78c104d80f1ea2bb1072f84 | |
parent | f115d0b9fafc900e815cde91db4b8ba6103d9102 (diff) |
remove trailing space on save
-rw-r--r-- | plugin/vim-options.vim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plugin/vim-options.vim b/plugin/vim-options.vim index 7260497..f9a87e0 100644 --- a/plugin/vim-options.vim +++ b/plugin/vim-options.vim @@ -55,6 +55,8 @@ highlight ColorColumn ctermbg=cyan au BufEnter *.py let w:m1=matchadd('ColorColumn', '\%81v', 100) au BufEnter *.py let w:m2=matchadd('Error', '\%121v', 100) au BufLeave *.py call clearmatches() +" Remove trailing space on save but use sed to maintain cursor position +autocmd BufWritePre * :%!sed -r 's/\s+$//' " Neovim (Docker) vs Vim |