In IntelliJ IDEA, when I have a vertically split window and I bring up "Search Anywhere" (SHIFT SHIFT) to jump to a new file, the file always appears in the left-hand split, even if my cursor is in the right-hand split.
How do I get the new file to open in the right-hand split?
Note that I'm using IdeaVim and I'm creating the initial vertical split by typing :vsp.
If you set up the right pane via right-click: Split Vertically, it works.
There must be an issue with :vsp.
(IDEA v14.0.2)
Related
Am trying to shift multiple lines of code in intellij IDEA by a single space using Tab shortcut but it always shifts by 4 spaces rather than a space. I have tried Edit > Convert Indent > To spaces but to no avail.
How do you shift multiple lines of code by a single space without messing with the default configuration for the file?
As #Andrey already suggested, I would use the Multi Cursor feature that has been around since intellij idea version 13.
I like the Add selection on Next Occurrence feature very much. It helps me to edit multiple lines very fast.
This screenshot shows the action in the Settings -> Keymap screen.
How can I select several lines in Intellij using keyboard shortcuts?
I found out that I can do it with
ctrl + shift + right/left
But I have to press this buttons several times to select whole line.
What is more the selection starts from current caret position, so if it's not the beginning/end (depending of using left or right arrow) of the line, the whole first line is not selected.
What I usually do is to hit the Home key, and then either:
Shift+End to select until the end of the current line, or
Shift+Down to select until the next line, and then keep pressing Shift+Down to select multiple lines.
Also, IntelliJ IDEA supports the "Extend Selection" and "Shrink Selection" commands, for which the default key bindings are Ctrl+Alt+Left and Ctrl+Alt+Right.
These allow you to select entire blocks of code rather than word by word. You may still need to press the keys multiple times, but way fewer times than when selecting on a word by word basis.
I'm an IntelliJ user since years and I work on a Mac.
For a long I was able to execute like an automata the following procedure:
select a portion of a text in a file using the mouse
pressing a combination of keys
seeing the selected text in the find & replace bar of the IDE.
Now, I can't remember how to do it.
I have search through the docs of the search & replace in a file, but I cannot see that option.
Just to avoid confusion, the toolbar I'm talking about is the following
I am using IntelliJ on linux (Keymap : Default for xwin) and to select text I use Ctrl+W or Mouse double click. Then ctrl+R will put this text in replace text box
Probably it's a kind of bug. It should work by selecting the text and pressing cmd+r.
Cases when it works:
I select a piece of text in a line and I press cmd+R.
I select the whole line (including white spaces/tabs at the beginning)
Case when does not work:
I select a line from the first character to the last.
More context. I use IntelliJ 2017.2.5 on Mac Os Sierra.
Is there any way to select the whole line at caret in IntelliJ 15? I know you can select the current word (ctl + w), go to beginning/end of line but I can't find a current line selection feature.
Simply hit
ctrl+c
Note that for this to select the whole line, you need to ensure that nothing is already selected; otherwise it'll work as an usual "copy" command.
move caret to line
on Windows, press ctrl+shift+a .
This popup appears, where you find Select Line at Caret
for quick access, you can specify a shortcut in Settings
I would like to also add the following from JetBrains website. Because, that what i was looking for here, but no one mentioned it.
1- To select text from the current caret position to the beginning/end of
the current word:
Ctrl+Shift+Left, Ctrl+Shift+Right.
2- To select text from the caret
position to the beginning/end of the current line:
Double-click Ctrl and press Home/End
3- To select text from the current
caret position to the top/bottom of the screen:
Ctrl+Shift+Page Up, Ctrl+Shift+Page Down.
If none of the above are working, I suggest using end and home keys in combination with shift allowing you to select lines quickly.
Go to the end of the line and hit Ctrl+W. If you'll hit Ctrl+W at the beginning of the line it will select only one word.
Not a keyboard feature, but nice to use:
to select the whole row just click on row number on the left of the code.
In addition to that you can click and drag selection.
Moreover, you can doubleclick on the number of the first line of method which results selection of the whole method.
I'm wondering how can I can navigate to a character location? I have a script that will tell me the character location number, no line number.
INFO: log-process/3093 on local-machine: Some Log Message
The 3093 is the character location number.
I do this by selecting code from the start of the file. Then, total number of selected characters is displayed in the bottom right corner, so I can find the character that I only knew the number of.
In WebStorm, if you mouse click on the file line and char count in the bottom bar:
it will open up a dialog where you can type in the line and char position:
I had the same situation today. I have a minifed and uglified javascript file, and I was simply searching manually for error (14, 4974). In the bottom right corner of Webstorm, you can see the line number and character position.
Searching for lets say line 14 and position 18438 is not an easy task, but clicking inside the script file may help you to pin point the location.
No such navigation action exists. You'll need to either 1) Search for a plug-in that will do this; 2) write your own plug-in to do it; or 3) Open a feature request to add such functionality.
UPDATE
The "Go to Line" dialog was enhanced to be "Go to Line:Column". You can open it by:
Ctrl+G / ⌘+L
Menu: Navigate > Line:Column
Click on the cursor position in the bottom right of the window. For example:
This will open the Go to Line:Column dialog:
In the dialog, you can enter a value such as 10:15 to go to the 15th character on line 10. You can also enter just a line, 10 which will take you to the start of that line (line 10 in this example). Or you can enter just a character position, for example :15, which will take you to that character position on the current line.
However, I am still unaware of a way say "Navigate to the Nth character position in the file". And the original poster's feature for such a feature is still open.