Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any variable rename plugins for Sublime text 2?

Tags:

sublimetext2

I'm using the Jetbrain WebStorm IDE, but I love Sublime Text, so if I got a renaming plugin for Sublime, I will drop my WebStorm, its so heavy for me.

like image 753
james Avatar asked Jan 27 '13 02:01

james


People also ask

How to rename variable in sublime Text?

The simplest way: put cursor on name, alt+f3 (select all), then type your new variable name.

How do I refactor code in Sublime Text?

You must press ctrl+D again to get additional selections in the file. For mac user: i prefer to use command+D. Press the buttons together multiple times to select the items to refactor.

How do I change a variable name in Visual Studio?

Select Edit > Refactor > Rename. Right-click the code and select Rename.


2 Answers

Sublime 2 has built-in functionality.

  1. First select the word you need rename (I used word instead of variable or function because it is applicable to ANY text file).

  2. Click Ctrl+D, multiple times. Each time you click Ctrl+D, it is going to select the next Occurence (most people miss the 'multiple' click part).

  3. Finally you can rename all highlighted occurences at one go.

There might be a better plugin out there, but this works right out of box.

like image 166
Som Poddar Avatar answered Oct 04 '22 10:10

Som Poddar


One of the best place to find plugins in on Will Bond's Community Sublime Packages site.

There is a plugin for python refactoring and one for javascript, but no general-purpose one (yet).

like image 26
emartel Avatar answered Oct 04 '22 12:10

emartel