Merge branch 'master' into 'master'

Removes trailing spaces automatically + (optional minimalist auto completer)

See merge request dwt1/dotfiles!10
This commit is contained in:
Derek Taylor 2020-06-28 20:50:17 +00:00
commit 40c7c3a94c
1 changed files with 14 additions and 0 deletions

14
.vimrc
View File

@ -188,4 +188,18 @@ set guioptions-=L "remove left-hand scroll bar
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set fillchars+=vert:\
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"=> Trailing spaces
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! CleanExtraSpaces() "Function to clean unwanted spaces
let save_cursor = getpos(".")
let old_query = getreg('/')
silent! %s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfun
autocmd BufWritePre * :call CleanExtraSpaces()