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

vim-ruby-refactoring – Rename Local 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 Local Variable

Renames the selected local variable.

Example

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

After refactoring:
RenameVar_After
The local variable mac_os has been renamed to is_mac_os in both locations within the method.

rrlv is the default binding for this refactoring, think Refactor Rename Local Variable.

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

Get every new post delivered to your Inbox.

%d bloggers like this: