mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-06 20:35:11 +01:00
Useful :TrimWhitespace command to trim trailing spaces and such
This commit is contained in:
8
.vimrc
8
.vimrc
@@ -498,6 +498,14 @@ set listchars=tab:▸\ ,trail:·
|
||||
" Display whitespace
|
||||
set list
|
||||
|
||||
" Trim trailing whitespace with :TrimWhitespace
|
||||
fun! TrimWhitespace()
|
||||
let l:save = winsaveview()
|
||||
keeppatterns %s/\s\+$//e
|
||||
call winrestview(l:save)
|
||||
endfun
|
||||
command! TrimWhitespace call TrimWhitespace()
|
||||
|
||||
" enable words completion
|
||||
set dictionary+=/usr/share/dict/words
|
||||
" use ctrl-n ctrl-n instead of ctrl-x ctrl-k
|
||||
|
||||
Reference in New Issue
Block a user