When I use IntelliJ, and a certain line in the code calls a function, if I put the cursor on the function call, hold the ctrl key and pound the left button in the mouse, IntelliJ brings me to the function that I call.
My question is do I have any option to get the same functionality without touching the mouse?
This navigation shortcut is called Go to declaration.
It can be used by either pressing Ctrl + Mouse Click or Ctrl + B
Additionally, there is also a Go to implementation shortcut:
Ctrl + Shift + Mouse Click or Ctrl + Shift + B
Related
In previous verions of InteliiJ IDEs it was possible just to hold Alt button and column-selection mode was ON (at least MacOS). Right now to enable it you have to switch mode every time on & off by pressing Alt+Shift+8.
How to use column selection only by holding Alt + mouse select? is there any config?
If you want to highlight several separate chunks of code (or place multiple carets) at once, you can drag (or click) the mouse while holding Alt+Shift. IDEA action name: 'Add or Remove Caret'
Dragging the mouse while holding Ctrl+Alt+Shift (Meta+Alt+Shift on Mac) will produce a rectangular selection that will also stack with the previous selections. IDEA action name: 'Add Rectangular selection on Mouse Drag'
You can also press Ctrl twice, and then without releasing it, press Up or Down arrow keys.
This help page has a lot of related useful information on the subject.
On Windows it's Ctrl + Alt + Shift + Click, no matter whether you are already in column mode or not.
If you want the keybinding to be ⌥ALT + mouse drag then you can change the keybindings in Preferences > Keymap > Editor Actions like so:
Create Rectangular Selection on Mouse Drag to ⌥ Click (clears old cursors)
Note that it should be Create instead of Add, and if you like you could set
Add Rectangular Selection on Mouse Drag to ⌥ ⇧ Click (keeps old cursors)
I am on windows.
In intelliJ Ultimate, there is at the top right corner of the window a horizontal tab labeled "1.Project". Pressing shift + esc will hide the file tree. However, pressing the same key combination does not unhide it.
How can I unhide this? Or create a custom binding that will toggle hide to unhide if it is already hidden?
Clément Baconnier was correct. alt + 1 was the key binding. cmd + 1 on osx.
Alternatively, I learned how to fish using the Action pane ctrl + shift + a that let me search for "Project" which exposed the keyboard shortcut.
Code folding doesn't work with key binding Shift + Alt + Cmd + <- left in Xcode 9.
Is anyone having same problem with Xcode 9?
Updates in Xcode 10:
Xcode 10 has increased support for code folding, including:
A new code folding ribbon showing all of the multi-line foldable blocks of code in the editor
A new style for folded code in the editor that allows you to edit lines with folded code
Support for folding any block of code enclosed in curly braces
Support for folding blocks of code from the folding ribbon, from structured selection, or from the
Menubar ► Editor ► Code Folding ► Fold menu item
Look at this snapshot:
Code folding was disabled in Xcode 9 beta 1, which is working now, in Xcode 9 Beta5 according to beta release note: Resolved in Xcode 9 beta 5 – IDE
Here is how:
Press and hold ⌘ (command) button in keyboard and move/hover mouse cursor on any (start or end) braces. It will automatically highlight, block area.
Keep (hold) ⌘ (command) button in pressed condition and click on highlighted area. It will enable quick menu popover window with Fold option.
Select Fold from menu list. It will fold your code and shows 3 dots, folding/covering entire block.
Now, to again unfold your code block, release ⌘ (command) button and click on 3 dots folding a block.
For easy understanding, look at this snapshot:
It's all keyboard short cuts are also working.
Fold ⌥ ⌘ ← option + command + left arrow
Unfold ⌥ ⌘ → option + command + right arrow
Unfold All ⌥ U option + U
Fold Methods & Functions ⌥ ⌘ ↑ option + command + up arrow
Unfold Methods & Functions ⌥ ⌘ ↓ option + command + down arrow
Fold Comment Blocks ⌃ ⇧ ⌘ ↑ control + shift + command + up
Unfold Comment Blocks ⌃ ⇧ ⌘ ↓ control + shift + command + down
Focus Follows Selection ⌃ ⌥ ⌘ F control + option + command + F
Fold All ⌘ ⌥ ⇧ ← command + option + shift + left
Unfold All ⌘ ⌥ ⇧ → command + option + shift + left
Code folding options from Xcode Menu:
Menubar ► Editor ► Code Folding ► "Here is list of code folding options"
Here is ref snapshot:
Same options from Xcode Short-cut list:
Menubar ► Xcode ► Preferences ► Key Bindings ► "Here is list of code folding short-keys"
Code folding is one a long list of things that isn't implemented in the new editor yet.
UPD:
Now after release of Xcode 9 code folding works now with former shortcut ( Shift + Alt + Cmd + left arrow)
Note: For only folding the scope you are in, press Alt + Cmd + left arrow.
It is the missing code-folding ribbon that is really making things incredibly difficult. I wouldn't have 'upgraded' if I had known.
According to release notes. Code folding is not supported in Xcode 9.0.
The source editor in this beta version of Xcode 9.0 doesn’t support code folding. (29396003).
And as with all beta software, there are lots of open issues that are well documented in beta release notes.
I want to add my own key mappings as combinations of keyboard and mouse events. Examples:
Ctrl + left click
Ctrl + left double click
Ctrl + mouse over
Alt + mouse over
How can I achieve this?
Attempts:
I went to Settings... > Appearance & Behavior > Keymap , but there are only 3 options:
Add Keyboard Shortcut
I can press some keys, but IntelliJ doesn't recognize the mouse events here
Add Mouse Shortcut
It works only for click / double click, keyboard is ignored
Add Abbreviation
I observed that some existing mappings already have such a combination where "left click" appears as "Button1 Click", but I don't know how to insert this text there because there is no Paste option and Ctrl + V is recognized as a key mapping, not as a command. I also tried to drag&drop some text, but it didn't work.
Details:
IDE: IntelliJ IDEA 14.0.1
O.S.: Windows 7
You need to enter a mouse shortcut, and simply use the modifier key when you click the message: "Click here to enter mouse shortcut". The mouse button plus modifier should show up under the Shortcut Preview section of the dialog.
While in Eclipse, when editing a file, one can quickly get to a method by name. Does IntelliJ provide the same functionality via some shortcut?
Ctrl + F12 will show a pop-up that allows you to find a method within current class. Ctrl + F12 again includes methods inherited from parent class. For those on Mac, fn AppleF12 will do the trick.
BTW if you want to find a method in any file knowing its partial name, try Ctrl + Alt + Shift + N - works also for fields.