Skip to content

Commit

Permalink
Add a function and <leader>sw mapping to manage with cleaning extra w…
Browse files Browse the repository at this point in the history
…hitespace
  • Loading branch information
Yomi Colledge committed Aug 28, 2015
1 parent 2b522d3 commit 6dab2b7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bindings.vim
Expand Up @@ -104,4 +104,15 @@ noremap <leader>ct :!ctags -R .<CR>
"
noremap <leader>gsa :Git scribe gen all<CR>
noremap <leader>gss :Git scribe gen site<CR>
noremap <leader>gsp :Git scribe gen pdf<CR>
noremap <leader>gsp :Git scribe gen pdf<CR>
" strip trailing whitespace
"autocmd BufWritePre,FileWritePre * call StripTrailingWhitespace()
function! StripTrailingWhitespace()
normal mz
normal Hmy
exec '%s/\s*$//g'
normal 'yz<cr>
normal `z
endfunction
nmap <silent> <Leader>sw :call StripTrailingWhitespace()<CR>

0 comments on commit 6dab2b7

Please sign in to comment.