Skip to content

Instantly share code, notes, and snippets.

@agilecreativity
Created September 17, 2013 07:18
Show Gist options
  • Save agilecreativity/6590982 to your computer and use it in GitHub Desktop.
Save agilecreativity/6590982 to your computer and use it in GitHub Desktop.
Vim mapping for clean up files
" Upgrade hackrocket to ruby 1.9 syntax
vnoremap <leader>h :s/:\(\w*\) *=>/\1:/g<cr>
" delete all trailing whitespace in current file
map <leader>w :%s/\s\+$//gce \| w<cr>
" delete all trailing whitespace for each file in repo
map <leader>W :args `git grep -lI .` \| argdo %s/\s\+$//gce \| w<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment