Commit 086603a0 authored by Adrien Oliva's avatar Adrien Oliva

Add <F5> mapping to remove trailing whitespace

parent ba44ea71
......@@ -51,7 +51,7 @@ endef
define update-ycm
@(cd $$(find $(VIMPATH)/pack/ -name youcompleteme) && \
git submodule update --init --recursive && \
git submodule update --init --recursive --remote && \
./install.py --all)
endef
......@@ -102,7 +102,7 @@ hard-files:
prepare-plugin:
@git submodule init
@git submodule update --recursive
@git submodule update --recursive --remote
plugin-soft: prepare-plugin
$(call soft-install, "$(VIMPATH)/pack", "$(PWD)/pack")
......
......@@ -11,3 +11,14 @@ set backspace=indent,eol,start
set expandtab
set tabstop=4
set shiftwidth=4
function! Preserve(command)
" Preparation: save last search and cursor position
let l:winview = winsaveview()
let l:old_query = getreg('/')
execute 'keepjumps ' . a:command
call winrestview(l:winview)
call setreg('/', l:old_query)
endfunction
nmap <F5> :call Preserve('%s/[ \t]*$//')<CR>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment