Shortcut for opening the definition file in a split vertical group in vscode - keyboard-shortcuts

Are there any shortcuts to open the definition (e.g.: a method definition) in a split vertical group? By ctrl + click on the usage of method, it opens in a new tab. It bothers me, because I have to leave my own tab.
(I know that after opening in a new tab, by pressing ctrl + \ it will be open it in a new group, but this also has the same problem: I lose my own tab, and a second problem: when I want to close the definition file, I have to close it from both the 2nd group and the 1st group.)
Are there any shortcuts to open the definition file directly in a new group?

Ctrl+Alt+Click seems to open the definiton file in a split editor.
It'll open to whatever you have this setting:
Workbench > Editor: Open Side By Side Direction // options are right and down
Note that it'll directly open the definiton file in a split editor only if there is a single possible defintion file. For example, you may have both a source and a dist folder with the same files in them (after some task runner commands perhaps). If there is more than one option, vscode will instead open a peek window with the multiple references listed to the right side. You can Ctrl+Click on whichever of those you want to open to the side.

Related

VSCode shortcut for move open editor up / down (not group but open editor)

I don't mean move editor group or viewed file (split editor groups); -- but in the list of open editors in the sidebar.
They can be rearranged by mouse-dragging them into desired position. Can't find the name for shortcut command, if it exists.
For clarity, attaching a screenshot: (it's unfortunately way too large)
Use case is rearranging open editors according to some flow (of data, functions or whatever) to simplify thinking about it.
Thanks!
I do not see any command that would allow you to re-order the Open Editors list directly.
But the order of that list is determined by the order of your opened tabs, so if you move the file tabs around the Open Editors list changes to match. So these would do what you want:
Move Editor Left: Ctrl+Shift+PageUp
Move Editor Right: Ctrl+Shift+PageDown
This works even if you have the setting Editor: Show Tabs disabled so that only a single tab is displayed - you can still move that tab left and right and that is reflected in the Open Editors list!!

Can I open a file in a new split screen tab with a keyboard shortcut in IntelliJ?

In VS Code I can press command + P to search for files and then when I find the one I'm looking for I can press Command + Shift + Enter to open the file in a new tab that adds a split pane to the window.
I can browse in a similar way in IntelliJ pressing Shift twice, but I can't figure out how to open the file in a tab in a split pane, just in a new tab in the same pane on pressing Enter. Is there a way to do it?
On the tab line, where all of your files are tabbed and opened, you can right click and see the option Split Vertically and Split Horizontally. They will split your window as needed. You can bind these options to a macro and automatically have anything split in a second.
Then you can just open any file with your explorer, and then run your key combination to split it!
Edit: you can create key mapping from the Settings -> Keymap menu.
Mr. Robot
I think, it's too late to answer this question.
But anyways, there is already a predefined keymap binding as per your requirement to open a new file in a split window.
keymap is Shift + Enter
After searching any file, you just have to press this combination and it will open that new file in a split window.
*This keymap is for Mac, it may be different for other OS.

In Intellij IDEA how to compare 2 text files that are not part of an open project

I would like to compare 2 files in intellij. Both files are not part of a specific project.
Is there a way to do so?
I am running Intellij 15 and 16.
The following works for me in IntelliJ IDEA Ultimate 14.1.7 on Windows:
Open the first file in the IDE (either by dragging from Windows Explorer into the window, or by File / Open).
In the view menu, choose "Compare With…"
In the "Select Path" dialog that appears, select the second file (either directly, or by dragging from Windows Explorer into the dialog).
It then opens up in the traditional file comparison pane. If you try to edit one of the files, it presents the usual "Are you sure you want to edit a file that's not in your project" dialog, which one can accept if that's what one is trying to do.
You can use the "compare with clipboard" feature.
From https://www.jetbrains.com/help/idea/2016.1/comparing-files.html#clipboard:
Comparing a File in the Editor with the Clipboard Contents
Open the desired file in the editor.
Right-click the editor pane and
choose Compare with Clipboard on the context menu.
View and manage
differences in the Differences Viewer for Files.
You can use intellij to compare 2 files/clipboard/blank text etc
Use command Shift+Command+A to search Actions
Type "Open Blank Diff Window" to compare random text
type diff for all diff options.
I use this on the command line (with IntelliJ IDEA CE on a Mac):
/Applications/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea diff ~/Junk/file1.txt ~/Junk/file2.txt
Window > Editor Tabs > Split Vertically
Is that what you're looking for? It's what I was looking for.
Worked for me on Mac OS High Sierra + IntelliJ IDEA 2018.3
- File -> Open
- Select file 1
- View -> Compare with ...
- Select file 2
To use intelli's difference comparison between 2 different files, you can use the Compare With (Right click the file in Project window). There is also an option to Compare File in Editor. To use that option, ensure one file is open and selected, then right click the 2nd file, clicking Compare File in Editor

How do you configure IntelliJ IDEA to place the cursor in the editor window after hitting enter on a file in the project window?

I'm big on not using the mouse, especially while writing code. I've noticed in IntelliJ IDEA 2016.1 that when I'm navigating in the project window, hitting Enter while a particular file is selected opens the file in an editor, but it doesn't place the cursor in the editor. Interestingly, if I double-click on the file in the project window, the cursor is placed in the editor.
How do I configure IntelliJ to place the cursor in the editor after opening the file via Enter from the project window?
To the best of my knowledge, I do not believe there is a way to configure what you are looking for. A search for focus in the settings didn't turn up anything.
That said, hitting Esc when in the project view will return you to the editor. So you would need to do Enter, Esc. If having to type two keys in a row bothers you, you could always record a macro (Edit > Macros) to do that key sequence and map it to a shortcut.

PhpED How to jump in an instance to Favourite File

I have a file in my project I frequently need to open, and I am forever looking for it. OK, I can usually find it via Ctrl + Tab (as it was recently accessed) or via the drop-down menu right of the file tabs, or via Ctrl + Shift + N to search for the file by name, but all of these take too long.
A Global bookmark would be awesome or a 'favourite files' tab I could float... does anything like that exist? I tried floating the file itself as well as adding it to a 'New Tab Group' (both can be done by right-clicking the file tab), but both of these options take up valuable space - you cannot have the file auto-hide in the way unpinned tabs do.
Does anyone have a trick up their sleeve?
It's a little on the nose and not the perfect "global bookmark" solution sought, but renaming the file so that it appears at the top of the drop-down tab list is half a solution. The file is still two clicks away - one would be better.