aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/utils.vim8
-rw-r--r--core/mappings.vim2
-rw-r--r--lua/plugins.lua3
3 files changed, 4 insertions, 9 deletions
diff --git a/autoload/utils.vim b/autoload/utils.vim
index 4847ca7..891ab78 100644
--- a/autoload/utils.vim
+++ b/autoload/utils.vim
@@ -1,11 +1,3 @@
-" Remove trailing white space, see https://vi.stackexchange.com/a/456/15292
-function! utils#StripTrailingWhitespaces() abort
- let l:save = winsaveview()
- " vint: next-line -ProhibitCommandRelyOnUser -ProhibitCommandWithUnintendedSideEffect
- keeppatterns %s/\v\s+$//e
- call winrestview(l:save)
-endfunction
-
" Create command alias safely, see https://stackoverflow.com/q/3878692/6064933
" The following two functions are taken from answer below on SO:
" https://stackoverflow.com/a/10708687/6064933
diff --git a/core/mappings.vim b/core/mappings.vim
index b714580..07112b4 100644
--- a/core/mappings.vim
+++ b/core/mappings.vim
@@ -128,7 +128,7 @@ nnoremap cc "_cc
xnoremap c "_c
" Remove trailing whitespace characters
-nnoremap <silent> <leader><Space> :<C-U>call utils#StripTrailingWhitespaces()<CR>
+nnoremap <silent> <leader><Space> :<C-U>StripTrailingWhitespace<CR>
" check the syntax group of current cursor position
nnoremap <silent> <leader>st :<C-U>call utils#SynGroup()<CR>
diff --git a/lua/plugins.lua b/lua/plugins.lua
index bd47db2..22343c6 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -312,6 +312,9 @@ require("packer").startup({
-- showing keybindings
use {"folke/which-key.nvim", event = "VimEnter", config = [[require('config.which-key')]]}
+
+ -- show and trim trailing whitespaces
+ use {'jdhao/whitespace.nvim', event = 'VimEnter'}
end,
config = {
max_jobs = 16,