Skip to content

Instantly share code, notes, and snippets.

@dtuite
Last active August 29, 2015 14:02
Show Gist options
  • Save dtuite/a89d3a1083c0b4f9a669 to your computer and use it in GitHub Desktop.
Save dtuite/a89d3a1083c0b4f9a669 to your computer and use it in GitHub Desktop.
Useful Ruby Vim Macros

Block Expansion

T{i<80>kbdo^M^[/}^Ms^Mend^[k

Turn a {} single line block into a do..end block.

Example:

expect { something.run }.to raise_error

With the macro stored in the d register, place your cursor inside the curly braces and press @d. The braces will expand to:

expect do
  something.run
end.to raise_error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment