ontheweblop.blogg.se

Intellij key map to create variable from expression
Intellij key map to create variable from expression










INTELLIJ KEY MAP TO CREATE VARIABLE FROM EXPRESSION CODE

When it comes to writing code, I use Ctrl + space (Basic code completion) a lot to auto-complete method names, variable names etc (or simply to see which methods are available for a certain object, by trying to auto-complete directly at the dot following the name of the object).įor searching in the current file I use Ctrl- F (Find - probably the least surprising shortcut in this list), F3/ Shift + F3 (Find next/previous) to repeat the search, and Ctrl + Shift + F (Find in path) to search in the whole project.Ĭtrl + W (Select successively increasing code blocks) is handy when selecting chunks of code. Yet another shortcut I use, both when reading and writing code, is Ctrl + P (Parameter info) at the arguments of methods and constructors, to see the types and names of the parameters. To find classes, I use Ctrl + N (Go to class), which lets you search using only the capital letters in the class name (“camel humps”), and * as wildcard. I prefer this over Alt + F7 (Find usages), which gives you the same information, but in a separate pane below. This gives you a pop-up list of all the usages, and you can easily navigate to each one. When I want to see all the places where a method or variable is used (which I want to do a lot), I use Ctrl + Alt + F7 (Show usages). If the caret is at the implementation of a method in an interface (indicated by the little green interface-symbol in the left gutter), this shortcut takes you to the interface itself. The opposite of this is Ctrl + U (Go to super-method/super-class).

intellij key map to create variable from expression

Press it when the caret is at the method name of an interface, and you get a pop-up list of all the places where this method is implemented, and you can select which one you want to go to (if there is only one implementation, you go straight there). This is almost always followed by Ctrl + Alt + Left to get back to where I was ( Ctrl + Alt + Right works to “go forward” again).Ī related navigation shortcut is Ctrl + Alt + B, (Go to implementation). The shortcut I use the most is Ctrl + B (Go to declaration), to see what a method does, where a variable is declared etc. Here are the Intellij IDEA keyboard shortcuts I find most useful (listed in roughly the order of usage for me): Use it on the implements keyword to highlight the methods of the implemented interface: Use it on a throws, try or catch keyword to show all places where the exception is thrown. Position the text cursor on any identifier without selecting any text and it will show all places in the file where that variable, method etc. Select in Popup to quickly select the currently edited element (class, file, method or field) in any view (Project View, Structure View or other): Can look in comments, text files and across different languages too: Rename refactoring to rename any identifier. Smart Type Completion to complete an expression with a method call or variable with a type suitable in the current Context: Quick JavaDoc Popup to show the JavaDoc of the method or class at the text cursor:

intellij key map to create variable from expression

Go to Class, to quickly open any class in the editor:Ĭomment/Uncomment current line or selection: Since version 8, IDEA intelligently selects a likely expression when no text is selected: This expression may even be incomplete or contain errors. Introduce Variable Refactoring, to create a variable from an expression. Use this to navigate to the declaration of a class, method or variable used somewhere in the code: For example, it may select a method name, then the expression that calls this method, then the whole statement, then the containing block, etc.:īasic Code Completion, to complete methods, keywords etc.: Syntax aware selection in the editor selects a word at the caret and then selects expanding areas of the source code. These are some of my most used keyboard short cuts










Intellij key map to create variable from expression