just ram

stuff I should remember

vim-ruby-refactoring - Extract Method

This post is part of a series which documents the vim-ruby-refactoring plugin.

IMPORTANT: As well as installing the vim-ruby-refactoring plugin, you must also install the matchit.vim plugin for this refactoring to work.

Extract Method

Extracts a selection into a method and places it above the current method.

The refactoring: http://www.refactoring.com/catalog/extractMethod.html

Example

Before refactoring:
ExtractMethod_Before
Visually select lines you wish to extract
Hit your **** then type **rem **You will now see a prompt to enter the new method name: Method name: print_details

After refactoring:
ExtractMethod_After
A new method print_details has been added above the print_owing method containing the contents of the selected lines.

rem is the default binding for this refactoring, think Refactor Extract Method.