Explicit Deselect in Sublime Text 2's Multiselect - keyboard-shortcuts

In Sublime Text 2, you can multiselect the next occurrence of a word with Command+D (on Macs, Ctrl+D on Windows). Is there a way to explicitly deselect an occurrence of a word?
Note: I know you can use Command+K, Command+D to skip an occurrence of a multiselect. The problem is that this command automatically still highlights the next occurrence of the word. I'm looking for a shortcut that simply deselects the last selection.

To deselect the last occurrence selected with ⌘ + D try using:
On Mac: ⌘ + U
On Windows: Control + U
Update: Confirmed this works on Sublime v3 & v4+

Try the following keyboard shortcut:
Ctrl+u
...or you can go the Edit -> Undo Selection -> Soft Undo

On Mac you can deselect any occurrence by using cmd+alt+shift+left mouse button
I have not found the similar shortcut for Windows yet.

On Linux and Windows, using the mouse:
To remove a selection from the multiple selection: Shift+Alt+RIGHT Mouse Button
To add a new selection to the multiple selection: Shift+Ctrl+RIGHT Mouse Button
To add a new cursor to multiple selection: Ctrl+LEFT Mouse Button
You may drag the mouse over what you need to deselect.
If you drag in the middle of a longer selection, you may end up with two new fragments of it selected that are separated by the area that you dragged the mouse over. Thus, sometimes by removing a selection you may create two new ones before and after.
Works in Sublime Text 3 as well.

Related

How to use Column selection mode Intellij IDE via holding Alt + mouse select?

In previous verions of InteliiJ IDEs it was possible just to hold Alt button and column-selection mode was ON (at least MacOS). Right now to enable it you have to switch mode every time on & off by pressing Alt+Shift+8.
How to use column selection only by holding Alt + mouse select? is there any config?
If you want to highlight several separate chunks of code (or place multiple carets) at once, you can drag (or click) the mouse while holding Alt+Shift. IDEA action name: 'Add or Remove Caret'
Dragging the mouse while holding Ctrl+Alt+Shift (Meta+Alt+Shift on Mac) will produce a rectangular selection that will also stack with the previous selections. IDEA action name: 'Add Rectangular selection on Mouse Drag'
You can also press Ctrl twice, and then without releasing it, press Up or Down arrow keys.
This help page has a lot of related useful information on the subject.
On Windows it's Ctrl + Alt + Shift + Click, no matter whether you are already in column mode or not.
If you want the keybinding to be ⌥ALT + mouse drag then you can change the keybindings in Preferences > Keymap > Editor Actions like so:
Create Rectangular Selection on Mouse Drag to ⌥ Click (clears old cursors)
Note that it should be Create instead of Add, and if you like you could set
Add Rectangular Selection on Mouse Drag to ⌥ ⇧ Click (keeps old cursors)

Keyboard shortcut to switch between horizontally split windows in Intellij

I've done numerous searches to find out how to switch between two files that are horizontally split but can't seem to find it. I know that you can switch between vertically split files by using the Goto Next Splitter option, but there doesn't seem to exist an option for horizontally split. Has anyone else figured this out? Thanks!
An example of a situation where I can't switch between the top and bottom files:
I just tried this out, and Goto Next Splitter (Option-Tab on mac) works just fine for me on horizontally split panes
Note: Using CLion 2017.1.2
If you have IdeaVim installed, you can use the Control-W - J/K command to switch between Vim split panes. See also How do I switch between panes in split mode in Vim?
Use Ctrl + Tab or Ctrl + Shift + Tab to switch between opened buffers (or "file editors", if you like). If you have only two buffers like on your screenshot, you can just press Ctrl + Tab and then by pressing Enter the other editor will become focused.
Important addition:
The shortcut varies depending on your keymap. To figure out proper key combination, open File -> Settings -> Keymap and search for "Switcher" keymap in the search field.

Move file from one editor window to another (split mode)

Is it possible to move a file (already opened) from one editor to another in split mode without using mouse and without using tabs (I have tabs disabled).
Example of what i want to accomplish. I enabled split mode (vertical) and opened file X in left editor. I want to move this file X to right editor because I already have file Y int left editor.
I found the command Move to opposite group which works fine only when tabs are enabled. When tabs are disabled (my case) call Move to opposite group force split mode to disappear.
Goto File->Settings
Then Keymap
Type in the searchbox "Move To Opposite Group"
Assign a shortcut
Also useful is "Goto Next Splitter" which allows you to switch between your Splitter.
But you'll hardly find a shortcut which is not already occupied.
I used Ctrl + NumPad+ for "Move To Opposite Group" and Ctrl + ArrowRight for "Goto Next Splitter"
You'll be notified that this shortcut is already in use, but you can ignore that. I had no conflicts so far
I agree with David Viehtauer and would add to his setup. This also won't work with tabs disabled, but has become essential to my workflow.
My prefered setup under Preferences > Keymap:
Move Right: ⌃ + ⌘ + ↓
Move To Opposite Group: ⌃ + ⌘ + ↑
Goto Next Splitter: ⌃ + ⌘ + →
Goto Previous Splitter: ⌃ + ⌘ + ←
Move Right will create a new splitter and send your current tab to it (if you have more than one tab on your current splitter). Once your file is in a new splitter you can go between your splitters with the Goto Next Splitter and Goto Previous Splitter shorcuts above. Now, using the Move To Opposite Group shortcut you can move your active tab to the preferred side.
Once you get familiar with this setup, you can quickly manage your tabs.
Action Open in opposite group is the closest solution I found.
Example of what i want to accomplish. I enabled split mode (vertical) and opened file X in left editor. I want to move this file X to right editor because I already have file Y int left editor.
After Open in opposite group action X will be opened in both editors. My workflow is "move" X to right editor and keep working in left editor.
My choice in this case was to use CTRL-SHIFT-a. I felt the command was not important enough to dedicate a shortcut to it.
As soon as the dialog appears, it is sufficient to type open opp and then you can already hit ENTER.
Here is another way to do this:
Put the cursor in the editor you want the class to display in
Bring up the search for class dialog (alt-o in my mac keymap, can't
remember if I customized this or not)
Search for your class
Select it then hit cmd-shift-enter, it will open in the editor your
cursor is in even if it is already open in another editor pane

How can I expand multi-line selection to full lines in PHPStorm?

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.

Make tab indent the current line

I'm using IntelliJ IDEA to write Java and finding the default Tab behaviour (inserting a tab at the cursor position) quite annoying. I want it to behave like Shift-Tab.
Shift-Tab de-indents the cursor line if there is no selection, or every line in the selection if there is one, regardless of the cursor's position on the line. I tried to make Tab behave the same way by changing the keymap settings: I unbound the Tab key from Editor Actions → Tab so that it'd perform Edit → Indent Selection. But that only makes it indent the selection: if there's no selection, pressing Tab now does nothing.
It appears that the de-indent action for Shift-Tab is actually Editor Actions → Unindent Selection, but there's no corresponding action for indenting.
How can I make the Tab key indent the current line (increase the indent by one stop) if there is no selection?
Remove the keyboard shortcut from "Tab"
Add "Tab" as a keyboard shortcut to "Indent Line or Selection". When the dialog pops up asking you to "Leave" or "remove", click "Leave".
This works on at least IDEA 14+ but I haven't tested it on anything before that
You can press Ctrl+W which selects the nearest item to the cursor and then press Tab to indent or Shift+Tab to unindent the current line.
Not exactly what you need, but you can try Code | Auto-Indent Lines. There is also a known bug about the difference in the selection indent/unindent behavior.