Skip to content

Instantly share code, notes, and snippets.

@saimonmoore
Created February 23, 2010 11:27
Show Gist options
  • Select an option

  • Save saimonmoore/312085 to your computer and use it in GitHub Desktop.

Select an option

Save saimonmoore/312085 to your computer and use it in GitHub Desktop.
Handy vim commands and their break down
Command: " qa0f'yi'_Pa = <Esc>_guiwjq3@a " (without external quotes or spaces)
Breakdown:
qa - start recording a macro named 'a'
0 - Move cursor to first column
f' - Find first occurence of ' moving forwards
yiw' - Yank the inner word ignoring the '
a = <Esc> - Append ' = ' and enter command mode
_ - Move cursor to the first non-blank character from start of line
guiw - uncapitalize inner word selection
j - go down one line
q - stop recording macro
3@a - perform macro a 3 times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment