Is there a functionality like Ctrl + D in Sublime for Intellij Idea? - intellij-idea

In Sublime Text I used to select some text (say a variable name) and I would just type Ctrl + D to get the rest of the occurrences of the same text.
Is there a functionality like that in Intellij Idea IDE?

Select All Occurrences (Ctrl-Cmd-G on Mac OS X is already available, Windows hotkey Ctrl+Alt+Shift+J will be available from the next EAP – use double shift | Select All Occurrences action for now)

Related

Is there a keyboard shortcut to select current word?

In JetBrains PhpStorm, what is the keyboard shortcut to select the current word? (I mean the word where the cursor is)
Ctrl + W selects the current word (Extend selection).
Yes there is but it's different from one IDE to another, And here are 3 examples:
SublimeText: Selection -> Expand Selection to Word (The shortcut will be shown next to it according to your OS)
PhpStorm: Edit -> Extend Selection (The shortcut will be shown next to it according to your OS)
MAC Extended Selection Shortcut: ⌥ + ↑
MAC Shrink Selection Shortcut: ⌥ + ↓
MAC Select all occurrences: ˄ + Command + G
Visual Studio Code: Selection -> Add Next Occurrence (The shortcut will be shown next to it according to your OS)
MAC Add Next Occurrence: Command + D
MAC Select All Occurrences: Shift + Command + L
^+G
it should work across all JetBrains IDEs
If you have CamelHumps enabled, Alt + J will be your friend.
to select the current word in Php storm (if you're using Windows) you can use ctrl+j
you can change it from: setting → keymap → click the search icon next to the search filed(search by keyboard shortcuts) → type ctrl+j → find "Add Selection for Next Occurrence" and change the keyboard shortcut of that as you want
For the people that comes here in search of a way to just delete the word you are in the middle of, you can use ctrl+del+backspace (combining the two shortcuts ctrl+del / ctrl+backspace).
This deletes from the cursor to the beginning of the word (ctrl+ backspace) and then from the cursor to the end of the word (ctrl+del).
On Linux.
Select next word: Ctrl+Alt+J
Select all occurrences of word: Shift+Ctrl+Alt+J

shortcuts for netbeans to select next word for multiple editing

Is there any shortcuts to select next word in netbeans?
Like Ctrl+d in Sublime text select word (repeat select others occurrences in context for multiple editing)
In netbeans you can use CTRL + J (in MacOSX CMD + J).
See https://stackoverflow.com/a/39869089
Working version 8.2
Windows CTRL + J
MacOSX CMD + J
Not quite the same thing but if you are in a supported programming language you can use Ctrl + R to refactor variable's, funciton names, class names etc.

How to go to next/previous occurrence in current editor tab?

In eclipse, you can go to the previous/next occurrence of the selected word by pressing ctrl+, / ctrl+..
What is the equivalent in IntelliJ IDEA?
The feature is called Find Word at Caret:
Search for a word at caret enables you to quickly find the exact match for the current word, without changing any search options. With the match once found, you can navigate between the occurrences of the term.
You can use Ctrl+F3 for that:
select a word at caret
hit Ctrl+F3 and then F3 or Shift+F3 to navigate to the
next/previous occurrence
Mac OS
Please note that there is no shortcut on Mac OS. You'd need to use Cmd+Shift+a and type "Find Word At Caret" ("find wo" should be enough) or on the main menu, choose Edit | Find | Find Word At Caret. Press Cmd+g to navigate to go to the next occurrence.
Separate Plugin
Or, try this plugin - it supports using Shift+Alt+Up and Shift+Alt+Down to navigate up and down to each identifier occurrence
To make this feature available by default please, vote for IDEA-59638
Use Ctrl+Shift+F7 to highlight the usages of some variable in the current file, then use F3 or Shift+F3 to navigate through the highlighted usages.
(It works in IntelliJ IDEA 2016.1.3)
Finding Word at Caret: Ctrl+F3:
Search for a word at caret enables you to quickly find the exact match for the current word, without changing any search options. With the match once found, you can navigate between the occurrences of the term.
Note that after it has found occurrences, it immediately goes to the first occurrence.
The functions for this are called Go to {next,previous} highlighted element usage and are available by default only via the menu Edit→Find. No key press is associated to this function by default. (IntelliJ IDEA 2018.3 (Community Edition))
You can set them to a specific key press in the keymap: File→Settings→Keymap→Main menu→Edit→Find and double click on the function you want to set.
EDIT:
IntelliJ IDEA 2021.3 (Community Edition): via main menu Edit→Find Usage→Next(Previous) Highlighted Usage
CMD + Shift + F7 to select all occurrences
than CMD + G to navigate forward
CMD + Shift + G to navigate backward

What is the shortcut to find next occurrence of a word in IntelliJ IDEA?

In Eclipse the keyboard shortcut to find next occurrence of a word in a file was Ctrl + k . It finds the occurrence of the selected word in a file one by one in a loop. What is the equivalent keyboard shortcut for IntelliJ IDEA? If not can we configure it some how?
First you'll have to highlight a symbol by pressing Ctrl+Shift+F7.
Then you just press F3 or Shift+F3 no navigate between the highlighted symbols.
When done you press Esc to exit the highlight searching.
It is all described on Highlightning Usages in IntelliJ Web Help.
Add selection for the next occurrence on Linux Alt+J
Finding Word at Caret: Ctrl+F3.
On Mac it's Command + G, but you can check what works for your OS by looking at Edit -> Find -> Find Next....
AFAIK you have to select the word in the search bar first.. So, Command + F and then Command + G to go to the next occurrence.
In Android Studio 1.4, apparently Mac OS default keyboard shortcuts for element next occurrence (vars, methods, etc) are
NEXT/FWD: Command+G
PREVIOUS: Shift+Command+G
I did try all the answers w/out success, and finally I looked it up in Prefs->Key Bindings
There are also hotkeys for navigating next/previous highlighted usages.
Several years ago they were Alt+Wheel down and Alt+Wheel up. Today they are not set by default.
You can find them in Keymap preferences with highlighted element usage search phrase.
Please consider using the Multiple Selections for this:
Select the term you want to lookup;
Use Alt+J / Shift+Alt+J (or Ctrl+G / Shift+Ctrl+G for Mac OS X) to select other occurrences.
It will work the same as Shift+F3, but it will select every next occurrences. I found this way much more conveniant, as you can choose to edit all the matching string or just move the cursor to edit the last selected one (←/→).
The Multiple Selections feature is available since IntelliJ IDEA 13.1 RC, and compete with Atom or Sublime Text similar feature.
I could not get any of IntelliJ's native options for Find Next/Previous to behave like in Eclipse. Find Word at Caret comes close, but it only allows you to slurp and find the next word, not previous.
I wrote an IntelliJ plugin to reproduce the exact behavior as in Eclipse. You can find it here: https://plugins.jetbrains.com/plugin/10635-quick-find-plugin
you can set shortcuts same as in eclipse by setting keymap value as eclipse.
Steps in intellij:
Go to setting in file
search for keymap
In the dropdown section set Eclipse
Now all your shortcuts are same as in eclipse.
For MAC:
First you'll have to highlight a symbol by pressing Command+Shift+F7.
Then for next occurrence Command+G or Command+Shift+G
On my Mac it is:
ctrl-l to find next occurrence
ctrl-shift-l to find previous occurrence
IntelliJ Keyboard Shortcuts
On Ubuntu:
Next occurrence of selected word: F3
To expand the question slightly, the method to display the next occurrence of a search term in the Find In Path pane, is to steer to it using the up/down arrows and then hit Enter.
Start by looking for all occurrence of the key (control + g)
Then use ( shift + command + g ) to find previous occurrence and ( command + g ) to find next occurrence.
For those who use IdeaVim plugin, there is another option.
Add these entries into .ideavimrc:
map <C-j> <Action>(GotoNextElementUnderCaretUsage)
map <C-k> <Action>(GotoPrevElementUnderCaretUsage)
This maps the navigation to the next/previous element under caret using ctrl+j/ctrl+k. Of course you can map it to something else, but this suggestion follows the standard navigation keys in vim.

How to reindent lines in IntelliJ IDEA / WebStorm?

In Eclipse, I can select a few lines and press Ctrl + I to reindent those lines. How do I do the same in IntelliJ IDEA / WebStorm?
Note:
I don't want to "indent" or "unindent" the selected lines - that would "move" the text to the right or to the left manually. I want the IDE to be clever about how to position the lines.
I don't want to reformat anything, i.e. there should be no modifications to characters beyond the first non-whitespace character on every line.
Code | Auto-Indent Lines (Ctrl+Alt+I in Windows default keymap).
On a mac, it's Ctrl+Option+I by default.
What worked for me on mac was
⌘ + OPTION + L
Windows:
Ctrl + Alt + L
Mac:
⌘ + OPTION + L
In Webstorm the option can be found as "Reformat Code" in the keymap.
The default on Mac is Alt Cmd l