aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-11-02 22:49:02 +0800
committerjdhao <jdhao@hotmail.com>2021-11-02 22:49:02 +0800
commit9b9bd9dd4684a46e3d77515f613461887972aa10 (patch)
treec4fc44cec6775fa579e6930423315ec29acdf6cf /core
parent8ebbec29d612d243e9eecb7e02227bacad9f97ea (diff)
remove trailing whitespace on save
Diffstat (limited to 'core')
-rw-r--r--core/autocommands.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/autocommands.vim b/core/autocommands.vim
index 9355d05..9fa0ea6 100644
--- a/core/autocommands.vim
+++ b/core/autocommands.vim
@@ -103,3 +103,9 @@ augroup packer_auto_compile
autocmd!
autocmd BufWritePost */nvim/lua/plugins.lua source <afile> | PackerCompile
augroup END
+
+" Remove trailing whitespaces
+augroup strip_trailing_space
+ autocmd!
+ autocmd BufWritePre,TextChanged * StripTrailingWhitespace
+augroup END