[JAVA] [Android Studio] A collection of shortcuts sent by people who love shortcuts [IntelliJ IDEA]

A collection of shortcuts for Android Studio and IntelliJ IDEA. We have carefully selected 10 pieces.

I love shortcuts, and when I switch editors, I just start looking at shortcuts. When I teach people shortcuts, I just over-teach them.

Even so, this time we made a careful selection. I feel that I have collected good shortcuts that are reasonably priced and of high quality.

You can change the key of the shortcut, so write down the recommended key settings. It is advantageous to change the ones that are used frequently. You can change the settings from Keymap on the settings screen. My environment is Linux (Fedora).

Shortcut collection

Search Everywhere (search all classes, files, etc.)

You can search for classes, files, etc. from the whole.

Windows/Linux Mac
Press Shift twice Press Shift twice

search_everywhere.gif

Call Hierarchy

You can hierarchically list the callers, such as where a method is called, where its caller is called, and so on. It's easy to look at each one when there are many callers, and it's useful because you won't overlook it.

Windows/Linux Mac
Control + Alt + H Control + Option + H

call_hierarchy.gif

Find Usages

You can find out where variables, classes, and methods are used, by looking for references to variables, or looking for extensions to a class. Variables display the location where the variable is being read and the location where it is being written. So it's useful for finding things like "Where is this variable rewritten?"

Windows/Linux Mac
Alt + F7 Option + F7

find_usages.gif

File Structure (displays the structure of the file)

You can see a list of variables and methods in the open file. What's more, you can search the list and jump to the location where variables and methods are defined.

Windows/Linux Mac
Control + F12 Command + F12

file_structure.gif

Find in Path

You can search the contents of all files.

Windows/Linux Mac
Control + Shift + F Command + Shift + F

find_in_path.gif

Delete Line

You can delete one line.

Windows/Linux Mac
Control + Y Command + Backspace

delete_line.gif

Extend Selection, Shrink Selection (Increase selection, reduce selection)

Each time you do this, the selection will scale. For example, if you execute it several times with the cursor on the variable,

  1. Select the entire variable
  2. Select the left side of "="
  3. Select one line
  4. Select the entire method

The selection range gradually expands.

Windows/Linux Mac
Expand selection Control + W Option + Up
Shrink selection Control + Shift + W Option + Down

selection.gif

Extract Variable

Extracts things around the cursor as variables. The following two are common uses.

  1. Write and execute only the right side of =. It automatically fills the left side of =
  2. Execute where the method is called consecutively with foo (). bar (). It splits this part into two lines, one that gets the return value by foo () and the other that calls the return value bar ().

Especially the first one is very frequently used. You don't have to write the left side of = yourself, which simply greatly reduces the amount of typing.

Windows/Linux Mac
Control + Alt + V Command + Option + V

extract_variable.gif

Rename

Rename variables, class names, file names, method names, etc.

Windows/Linux Mac
Shift + F6 Shift + F6

rename.gif

Next Highlited Error, Previous Highlited Error

You can jump to the next or previous error. You can save yourself the trouble of searching with the mouse.

Windows/Linux Mac
Next error F2 F2
Previous error Shift + F2 Shift + F2

error.gif

Unfortunately not selected

I was at a loss until the very end, but I was not selected. The shortcut is Windows / Linux.

Others-It's subtle but convenient to call it a shortcut

Really convenient guy

Digression

When different people talk about shortcuts Occasionally, "mouse operation" vs. "keyboard shortcut", which is faster? I sometimes talk about it in a binary opposition.

However, in reality, I feel that it is faster to perform both "mouse operation" and "keyboard shortcut" at the same time. I think it's easy to understand for those who draw pictures and those who play games, It's the same as those people operating a mouse or pen tablet with their dominant hand and a keyboard with their other hand.

Therefore, it is convenient to arrange the shortcuts so that you can operate the keyboard and mouse at the same time, basically with one hand.

Recommended Posts

[Android Studio] A collection of shortcuts sent by people who love shortcuts [IntelliJ IDEA]
A memorandum because I was addicted to the setting of the Android project of IntelliJ IDEA
A collection of Eclipse shortcuts that new graduates find useful