I have 2 vertical splits and I would like to move a file from one split to another using the keyboard.
Is there any way of doing this?
Thanks!
Is there any way of doing this?
Yes.
P.S.
You can assign any shortcuts you want to those actions in Settings (Preferences on Mac) | Appearance & Behavior | Keymap
This question and several similar ones pop out regularly in the case of members of the IntellijIdea family of IDE's. I've seen it asked for example in the case of AndroidStudio.
Using an IntellijIdea-based IDE there is a general solution for finding any command without leaving the keyboard, and that is CTRL-SHIFT-a.
As soon as the dialog appears, in the case of this question it's sufficient to type move opp and then you can already hit ENTER to have the command executed.
Related
I have a file from our repository where I ran auto-indent (because it was a mess), and now the whole file is marked by blue changebars (down the right hand side of the editor window), making it difficult to find my changes.
I am already ignoring whitespace changes in the diff window (as described here: Intellij and changes tab), is there a way to also do this in the editor window?
I couldn't find a way to completely ignore whitespaces, but IntelliJ (I'm using version 2016) lets you set an option to color whitespace-only changes differentely:
Editor -> General -> Different color for lines with whitespace-only modifications
which helps tremendously.
At the moment [idea 13.5] it seems that is not possible to ignore spaces in the standard editor. You can open a support ticket
We also faced this in the company due the different codestyles used, at the end we settle for:
setting a common codestyle that everyone editing the code should [actually must] follow
reformat the whole codebase to the given codestyle
recommit the formatted code [without any addition or deletion, just the reformat]
It took just a bit of time, but at the end now we are working far better. In this way from that moment onward, we would have all the time the code that would aesthetically the same trough next versions.
You can completely disable the highlight of whitespace modified lines in :
Settings -> Editor -> Color Scheme -> VSC -> Editor Gutter -> Whitespace-modified lines
And then uncheck the background color :
Essentially, you want Intellij to use the --ignore-all-space or --ignore-space-change upon a merge.
My developer team also deals with this challenge because we have different code formatting preferences. The result is every merge is painful for no reason. The team loves being able to have their code formatting, but this negates it.
As of now there is no solution. Intellij has the technology to ignore whitespace, so fixing this is really just adding a check box on the merge diff screen or even in the version control settings.
There is a feature requests IDEA-107714
Please up vote it!
https://youtrack.jetbrains.com/issue/IDEA-107714
Try this,
View --> Active Editor --> Show whitespaces
this is guaranteed to solve your problem
IDEs based on the IntelliJ platform let you split the editor in various ways, but I don't see an option to move focus from one editor to another using just keyboard (something like other-window from Emacs).
Is there an "action" to do that?
For mac users, the default shortcut is option + tab
I think you're already find answer, but for someone who have same question and find this post like me.
Go to Prefernces -> Keymap or simple use search in preference and find Goto Next Splitter and make your own hotkey for this action.
Main Menu Window | Editor Tabs | Select Next/Previous Tab
There's also Switcher (Ctrl+Tab) available in the same menu as Goto Next/Previous Splitter which switches between splitted editor parts, tool windows, and many other things.
For macOS it is option + tab keys to switch between tab groups
ctrl + tab works for Windows system.
I know this is a simplistic question; but I've been using IntelliJ for months now, and can't find this simple feature.
Any idea? Thank you.
Idiot me. CMD-F4 or, as mentioned before, CTRL-F4.
Thank you all. I'll just bury myself now :)
hmm you can't because there is no default key binding for that, at least on OSX, however you can go here and define one:
The standard tip if you don't know how to do something in Idea is "Find Action..." (ctrl+shift+A in Windows) then type what you want to do, in this case close.
You will get a lot of different "close" actions and simply "Close" (ctrl+F4 in Windows) will be one of them.
You can also set a custom key combination in the settings menu
Click on File > Settings and select Keymap from the menu on the left, then scroll down to the Other section and set your preferred key combination for Close Active Editor:
When you double-click on Close Active Editor, a menu pops up allowing you to set a key combination, a mouse gesture, or even an abbreviation for the action. If the shortcut is already set somewhere else (as in my case with Ctrl-W) you'll get a notification and won't be able to set the shortcut until you remove the other one.
As with Matt Ball, I don't use IntelliJ but may also be CTRL+F4...
For MAC user, Cmd-W will close the active tab (file).
On Mac, you might like to use CMD + W, as this is the conventional shortcut for closing things e.g. Tabs in Chrome.
But by default this is usually associated with highlighting the current cursor block, so instead I use CTRL + W, rather than re-assigning.
e.g. (bottom right)
Also works for other IntelliJ IDEs, like WebStorm, etc.
IDEA->File->Setting->Search for "Close Active Editor".
Click on 'Add Keyboard Shortcut' -> Change it to "Ctrl+W". (Overwrite).
BOOM! you are universal now!
I'm on version 2020.4 and this has changed to Ctrl+4
If I split the editor window (horizontal or vertical) into N tab groups, how do I switch/toggle from one tab group to another via the keyboard? If all of the tabs are in the same group you can switch from each tab easily (CTRL + right/left arrow), but when they're in separate tab groups I can't. I've searched through the key mappings and have not found one that seems to accomplish this. I know I can use the mouse, but I'm trying to find ways to avoid the mouse and stay with the keyboard.
TIA for any help on this.
Ctrl+Tab and Ctrl+Shift+Tab for Window | Goto Next Splitter and Goto Previous Splitter. However, these hotkeys may be taken by the Switcher, so you need to remap them in Settings | Keymap.
It looks like it's now mapped to Alt+Tab and Shift+Alt+Tab so no need to remap (at least for OSX 10.5+ settings).
I had the same case and this plugin solve my problem:
https://plugins.jetbrains.com/plugin/7475-tab-shifter
https://github.com/dkandalov/tab-shifter
As I write this, here is what it support:
Move tab to another editor split
Move focus between splits
Resize the split
You may refer more details on the page/github. It works pretty well in 2019.2
I can switch the splitters with CTRL+E and then ENTER.
If you have more then 2 splits, then you can navigate or quick search in the Recent Files dialog.
Switching the splitters with the Switcher doesn't work.
My employer wants me to use IntelliJ for Java development. Previously, I've always used eclipse.
One of my favorite features in eclipse was being able to click on a variable, method parameter, class field, etc and see the usage of those variables highlighted throughout the class.
Is there a way to enable this feature in IntelliJ IDEA? I'm using Ultimate version 9.0.3.
File | Settings (Preferences on Mac) | Editor | General | Highlight usages of element at caret.
I think Intellij does not do this by default for a reason.
If you click in a symbol on your code, you can hit Ctrl+Shift+F7, then it will highlight (High visible, not just like the default underline) all occurences of the symbol. Good thing is, if you move out the cursor of that symbol, it will keep it highlighted wherever you go.
Tip: You can highlight how many different symbols you want at the same time.
Tip 2: F3 / Shift + F3 goes to the next / previous occurence respectively.
Go into Settings->IDE Settings->Editor->Color and Fonts->General
Make a copy of Dracula to something like MyOwnDracula (can't change the built in schema).
Find whatever you need to change, in this case it's "Identifier under caret" and change the colors for foreground and background to your liking.
Even though this is a question on how to highlight all variables, point one and two will answer that meanwhile point 3 will make you more productive and rename all variables simultaneously if you so choose to do so.
With your cursor on an occurence.
Do Ctrl+Shift+F7 to select all other occurrences.
Then Shift + F6 to rename all occurences simultaneously.