IntelliJ How to rename variables, files, folders. --(Say advanced point is refactoring) __idea

Source: Internet
Author: User

IntelliJ Idea Use tutorial (total list)


I said I really didn't know how to rename a variable, rename a file, or a folder when I just used the editor.

In theory, if you change a place, then all the other references should be changed automatically.

Otherwise, you are a change, if the reference to the place more to go, it does not change your AH.

So, there must be a quick and easy place to implement this feature. Say so much, also on a shortcut key thing.

"I am a shortcut to eclipse," says a brother. Yes, that's the shortcut on Eclipse, and this is what you can set.


As for this shortcut, do not care too much, because, we use the system is different, the keyboard mapping is different, that is, keymap different, may vary.

Specifically, look at this picture below.


To see what your shortcut key is:

Select the variable you want to rename, and I will select the method name. Then right click on the refactor, and then rename, you can put all references to a one-time change to the place.

The pose I described above is a description of the first picture in this article.


If you are familiar with it, you can use the shortcut key, Note: Your shortcut key is not necessarily the same as mine oh, I this is ALT + SHIFT + R.

Again, our shortcuts may not be the same, the table cares about this. (Can be set in accordance with the 2 figure, should be a lot of the students from eclipse turn around.) )


I just press the shortcut key, then directly modify, and then OK. Similar refactoring. This is the name of the change method.

If you do not want to change, press 2 to exit the ESC, you can. Alternatively, press ENTER to make sure you are OK.


Change folder name is also a posture, after the change, the corresponding file reference is automatically modified.


Change the file name is also a posture, notice, the following several box choice is what meaning is good.


This is still very common, before I know this, I think it is too simple, to the extent that no need to sum up.

Because a small partner did ask me this question, I think the summary, better.

It's convenient for new people to learn.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.