Merge branch 'master' into 'master'
Removes trailing spaces automatically + (optional minimalist auto completer) See merge request dwt1/dotfiles!10
This commit is contained in:
commit
40c7c3a94c
14
.vimrc
14
.vimrc
|
@ -188,4 +188,18 @@ set guioptions-=L "remove left-hand scroll bar
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
set fillchars+=vert:\
|
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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue