Object
+ shortcut
➜ Object object = new Object();
Whether there is such shortcut?
Invoke type-matching completion By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again.
To add or change the shortcut for any action, press Alt+Enter when it is selected in the list. Key Promoter X is a plugin that shows a popup notification with the corresponding keyboard shortcut whenever a command is executed using the mouse.
Ctrl+Alt+Shift+N : finds a symbol. In IntelliJ IDEA, a symbol is any code element such as method, field, class, constant, and so on. Ctrl+Shift+A : finds an action by name. You can find any action even if it doesn't have a mapped shortcut or appear in the menu.
As of 2017, improving on @aleksander's answer, I believe the best way to create a new object as efficiently as possible in Intellij IDEA, is this (click to enlarge):
Settings > Live Template
. +
to the right of the window, to add a new Live Template. n
or newo
). Description could be new Object
.$Clazz$ $obj$ = new $Clazz$($END$);
Edit Variables
button, and the fill in the Clazz
and obj
Expression and Default Value as shown in the picture above.Define
next to No applicable contexts
, to define Java > Statement
as the context.Now test it: Go to the editor, type n
and then the TAB
key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With