Home > Ruby, vim > vim-ruby-refactoring – Rename Instance Variable

vim-ruby-refactoring – Rename Instance Variable

31 December, 2010

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.

Rename Instance Variable

Renames the selected instance variable.


Before refactoring:
Visually select the instance variable you wish to rename
Hit your <leader-key> then type rriv
You will now see a prompt to enter the new variable name: 
Rename to: new_name

After refactoring:
The instance variable @name has been renamed to @new_name in both locations within the class.

rriv is the default binding for this refactoring, think Refactor Rename Instance Variable.

About these ads
  1. No comments yet.
  1. 31 December, 2010 at 1:35 am
Comments are closed.

Get every new post delivered to your Inbox.

%d bloggers like this: