When I have two Java files, and I want to compare them side-by-side, I split them vertically. However, I end up with 3 Java files, because it duplicates the one I split, instead of just moving it.
Is there a way to change the behavior such that it just splits the two files I have open, rather than creating a 3rd?
Not sure when this feature was added, but you can simply right-click the tab and choose Move Right ; it has the effect of splitting horizontally and then closing the old tab.
This is not possible. The concept of a split is just that, to split an editor. See Splitting and Unsplitting Editor Window in the help guide. You can create a second editor window by dragging a tab off the main editor window. See Detaching Editor Tabs in the help guide. Note, if you already have a split in place, you can drag a file from one split pane to the other.
You can also write a macro to accomplish what you want.
Give the tab you want to split focus
From the menu: Edit > Macros > Start Macro Recording
Record the following sequence:
Right click on the tab and split it
Type ctrl+F4 (or ⌘F4) to close the original window
Stop the macro (either view the popup in the bottom or via the Edit > Macros > Stop Macro Recording)
In the dialog, give the macro a name.
You can now either run the macro from File > Edit > Macros, or you can map a keyboard shortcut to it. See Binding Macros with Keyboard Shortcuts in the help guide for how to do such.
Don't use Split Vertically or Split Horizontally actions!
Instead, you can use Split and Move Right and Split and Move Down actions.
You can press Ctrl + Shift + A, and type "split ..." then choose the action.
Also, you could add shortcuts for them,
Related
In IntelliJ IDEA, is there a way with splitting editor tabs (split vertically/horizontally regardless) to just send a particular file to a newly split tab without leaving a copy in the original tab? (that I then have to close each time)
I work a lot with splitting editor tabs and it's a waste of time and focus that for every new split I have to also close the old tab (99,9% of time I use one tab per file).
It would be great to know if there already is a way to do what I want so I can use it or prepare a feature request.. or write a plug-in :>
Cheerio!
Use the Split and Move Right/Down actions in the editor tab context menu:
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.
I split the editor
and I want to show the file in the both sides of the editor,
most probably this is too easy but I can't find how to do that,
edit:
I find a way, I close all other files, and keep only the target file, and then I split the editor. now phpstorm will show the file in both windows. and then I reopen other files. but I don't think this is smart. Probably there is a better way.
thank you
In general: to split current tab in editor:
Right click on editor tab
choose Split Horizontally or Split Vertically
you can also use Move Down or Move Right -- but this will move editor tab into new split instead of "copying" it.
Let's assume you have this setup (notice "test.php" is already located in both splits):
Now you want to have "css.css" to be in both splits as well. Depends on your IDE version you will have 2 choices:
1) Split this file -- you will have 3 splits now:
Using mouse move "css.css" from newly created split into existing split:
2) Use Open in Opposite Group action
In newest version (my 2021.2) found this option here:
Window -> Editor Tabs -> Split Right/Split Down
In Sublime Text I can arbitrarily select a set of lines and then use ⌘+L to expand the selection to the full lines. Is there a similar command in PHPStorm / WebStorm? (I'd like to map that command to a keyboard shortcut.)
I know PHPStorm has the option "Select Line at Caret", but that selects only one line.
Update
Nowadays (welcome 2020) Go to Preferences > Keymap. Change or add the value to
Add Carets to Ends of Selected Lines => CMD+SHIFT+L to have it behave like Sublime Text so it looks like
Old Answer
This is as close as I could get it (before 2020):
Go to Preferences > Keymap. Search for Clone Caret Above/Below.
On a Mac, it looks like this
The keys are:
CMD+SHIFT+CTRL+ARROW_UP for Clone Caret Above
CMD+SHIFT+CTRL+ARROW_DOWN for Clone Caret Below
Click on Apply and it will work
With WebStorm 11 (at least) the multi-caret keyboard shortcut is:
Ctrl then Ctrl+Arrow Up (or click & drag with the middle mouse button/scroll wheel)
then to select the full lines:
Home then Shift+End
which you could even create as a macro with a keyboard shortcut.
I used to accidentally activate the multi-caret all the time (I scroll with Ctrl+Up/Down), so I knew how to do part of it, but it took me ages to figure out that extra Ctrl tap at the beginning.
Hold down Alt + Shift and left click on the lines you want to select. This will put multiple cursors on the editor. Now you can use the Select Line at Caret option you mentioned to select all those lines.
You can find more about multiple selections here.
This is currently not possible with a selection. However, you can still do that from the keyboard. Instead of doing selections set up a shortcut for Clone Caret Above (Alt+Shift+U for me) and Clone Caret Bellow (Alt+Shift+D for me). This allows to go up or down a line and add a caret there. So instead of selecting each line, you directly move the caret there and clone it.
I am also coming from Sublime Text and missing that feature, but this worked also pretty well.
What is the quickest way to jump to a particular symbol/selector/class in Xcode? (I'm looking for keyboard shortcuts preferably).
Right now, I know two ways of doing this:
“Open Quickly” > Click on the Symbols dropdown menu at the top of the editor > Select the selector to jump to it.
Click on “Project Symbols” in the “Groups and Files” section on the left sidebar, and type in a name in the Search text field in the top right of the XCode window.
Is there a quicker way of doing this? (If I could even assign a shortcut to jump to the “Project Symbols”, that would suffice for me. Alternatively, if I can find a keyboard shortcut to jump to the symbol dropdown above an editor that would do it to).
For experienced Xcode programmers, what do you use to jump to a symbol?
In Xcode 3.2, the "Open Quickly" command (Shift-Control-D) lets you type in selectors and class names as well as file names. This would at least get you close to what you wanted.
Your idea about using the "Symbols" drop-down also works. You can use the keystroke Control-2 to bring up the Symbols drop-down menu, and then use the arrow keys, or start typing the name of the method that you want to reach.
Edit: In Xcode 4, the "Symbols" drop-down appears when pressing Control-6. You can change this in the Xcode settings by changing the key binding for "Standart Editor > Show Document Items".
If you're looking at the symbol in a source file and want to jump to its definition, ⌘-click it.
(command + double click) on your symbol/selector/class in any place of your implementation to jump to them
(option + double click) on framework classes/selectors to jump to their reference in help->documentation
One (arguably crude) way to do it seems to be as follows:
This is based on the fact that the Search field at the top right of the Xcode window seems to change behavior depending on what is selected in the Groups & Files sidebar.
Select “Project Symbols” in the “Groups & Files” sidebar
Press ⌥⌘F (That is Command+Option+F) to jump to the Search field
Enter the symbol to jump to, and an outline will quickly show up
(this will remain in effect until you click on something else in the Groups & Files sidebar)