I'm using Mac, SublimeText2
When I used the mouse to click got_value, the words equal to got_value will be highlighted,
Then I press cmd+D , only the first 2 got_value were selected,
How could I make more got_values to be selected ? (by keyboard but not mouse click)
Thanks
Keep pressing cmd+d to select more instances.
Press cmd+u to unselect the last instance.
Or, to highlight them all
ctrl+cmd+g
Related
I want to be able to edit every line of my data simultaneously, for instance put quotations in front of every line. I am wondering what the key combination is that will enable me to do this.
Four steps:
Select all the text: CTRL A
Activate multi-cursors: CTRL (or CMD on Mac) SHIFT L
Press the Home key to move all cursors to the front of the line
Press the " quote key to insert the quote.
Using the Home End and CTRL + left | right arrow keys is handy when managing multiple cursors.
On a mac, you can highlight the lines you wish to edit and use CMDShiftL, or ctrlShiftL on Windows.
On Mac
cmd+A (Select all)
cmd+shift+L (Split selection into lines)
shift+2 (Surround selection with quotes)
esc (Escape)
On Windows
CTRL+A (Select all Data)
CTRL+Shift+L (Cursor will appear on each line)
Shift+ (right or left key) (move the cursor left or right)
Press ESC to remove the focus.
In case if you want to put cursor at every string as currently selected, use Find All shortcut:
Windows/Linux: Alt+F3
Mac: ⌃+⌘+G
All Multiple Selection shortcuts
I've a mysterious problem. I've built a browser-based application for a customer who prefers to use the keyboard - no mouse, no touch panel.
I have a simple HTML-Form like this which contains some times:
<input tabindex="1" name="abc" type="text" />
<select tabindex="2" name="efg">
<option value="10:00:00">10.00</option>
<option value="11:00:00">11.00</option>
<option value="12:00:00">12.00</option>
<option value="...">up to 24</option>
</select>
now my customer recognized that it's not possible to select the "11.00" option using keyboard. E.g. after hitting "TAB" and jumping to "select" you can enter "10" on the numblock of your keyboard and the option "10.00" is selected. It's possible on any time, except "11.00" and "22.00". Hitting the key "1" or "2" twice the pointer always jumps to the next option (e.g: twice "1" -> 12.00 is selected)
I've checked this behavior on any major browser under Linux and Windows: Everywhere the same issue.
jsFiddle
Is there an option to fix the problem?
Assuming you don't have any JavaScript interference, this select should be totally usable with only a keyboard with the default browser behavior. Once you have selected a dropdown using tab, you can:
Type a character to jump to the first option that starts with this character
Type the character again to jump to the next option that starts with this character (and so forth)
Use the up and down arrow keys to navigate through the options
Use the enter key, spacebar, or Alt + Down to expand the list of options
Use Alt + Up to collapse the list of options
Collapse the options by using Tab to jump to the next focusable element.
I dropped your sample HTML into a clean webpage, and everything worked as I expected. I'd check to see if you have any JS that is capturing the relevant keypress events.
I am finding I often will multi-select a bunch of single points (ctrl+click on the point) in Sublime Text 2, get to the end of the items I want to multi-select and then discover one in the middle of them all that should not have been selected.
I then have to cancel the multi-select (esc key) and start my selection all over.
Is there a way to deselect a single multi-select point? I looked all over the net and experimented with the traditional opposite items such as ctrl+shift+click on the point I want to deselect. No joy.
Thanks in advance for your help!
Try this one:
alt + Middle Mouse Button
this feature/shortcut is called subtract from selection.
In OSX ⌘+opt+shift+ left click removes an added multi-cursor.
On Linux, if you are using a touchpad, try using: Alt + Shift + Right-Click.
If you are on OSX, you need to disable drag_text.
Edit your user preferences, i.e. super + , and add this:
"drag_text": false
Otherwise, you can select just like before - ctrl + click (command + click), and to deselect an instance you use alt + click (command + shift + click).
To deselect any text region (this way also deselects any included cursor point(s)):
On Windows
Alt+Shift+Right_Mouse_Button (Drag-Select what you need to deselect)
OR: Alt+Middle_Mouse_Button (Drag-Select what you need to deselect)
On OSX
Command+Shift+Option+Left_Mouse_Button (Drag-Select what you need to deselect)
OR: Command+Shift+Middle_Mouse_Button (Drag-Select what you need to deselect)
This works on SublimeText 2/3.
In case you want to deselect a single cursor point (not a region), you can do the same and drag-select any region that includes that cursor point. [Example: My Wor[Cursor]d. To deselect the cursor you can drag-select on: r[Cursor]d (or any region including the cursor) and it will automatically deselect the cursor point.]
Source: Column Selection
I have installed Sublime Text 2 in windows and I am trying to use the multiple cursors feature.
Firstly I highlight the selection I am looking for (three lines).
Then I can press CTRL + D to select each re-occurrence, or ALT + F3 to select all. There are four repeats in my situation.
I now want to move the cursors in the middle of the three lines and add some information, to be added to all occurrences.
As soon as I click in the selection, the multiple selection is gone? Is there something I am doing wrong, I am sure it is wrong but as the documentation is so weak I cannot find out how?
It's usually just easier to skip the mouse altogether--or it would be if Sublime didn't mess up multiselect when word wrapping. Here's the official documentation on using the keyboard and mouse for multiple selection. Since it's a bit spread out, I'll summarize it:
Where shortcuts are different in Sublime Text 3, I've made a note. For v3, I always test using the latest dev build; if you're using the beta build, your experience may be different.
If you lose your selection when switching tabs or windows (particularly on Linux), try using Ctrl + U to restore it.
Mouse
Windows/Linux
Building blocks:
Positive/negative:
Add to selection: Ctrl
Subtract from selection: Alt In early builds of v3, this didn't work for linear selection.
Selection type:
Linear selection: Left Click
Block selection: Middle Click or Shift + Right Click On Linux, middle click pastes instead by default.
Combine as you see fit. For example:
Add to selection: Ctrl + Left Click (and optionally drag)
Subtract from selection: Alt + Left Click This didn't work in early builds of v3.
Add block selection: Ctrl + Shift + Right Click (and drag)
Subtract block selection: Alt + Shift + Right Click (and drag)
Mac OS X
Building blocks:
Positive/negative:
Add to selection: ⌘
Subtract from selection: ⇧⌘ (only works with block selection in v3; presumably bug)
Selection type:
Linear selection: Left Click
Block selection: Middle Click or ⌥ + Left Click
Combine as you see fit. For example:
Add to selection: ⌘ + Left Click (and optionally drag)
Subtract from selection: ⇧⌘ + Left Click (and drag--this combination doesn't work in Sublime Text 3, but supposedly it works in 2)
Add block selection: ⌥⌘ + Left Click (and drag)
Subtract block selection: ⌥⇧⌘ + Left Click (and drag)
Keyboard
Windows
Return to single selection mode: Esc
Extend selection upward/downward at all carets: Ctrl + Alt + Up/Down
Extend selection leftward/rightward at all carets: Shift + Left/Right
Move all carets up/down/left/right, and clear selection: Up/Down/Left/Right
Undo the last selection motion: Ctrl + U
Add next occurrence of selected text to selection: Ctrl + D
Add all occurrences of the selected text to the selection: Alt + F3
Rotate between occurrences of selected text (single selection): Ctrl + F3 (reverse: Ctrl + Shift + F3)
Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: Ctrl + Shift + L
Linux
Return to single selection mode: Esc
Extend selection upward/downward at all carets: Alt + Up/Down Note that you may be able to hold Ctrl as well to get the same shortcuts as Windows, but Linux tends to use Ctrl + Alt combinations for global shortcuts.
Extend selection leftward/rightward at all carets: Shift + Left/Right
Move all carets up/down/left/right, and clear selection: Up/Down/Left/Right
Undo the last selection motion: Ctrl + U
Add next occurrence of selected text to selection: Ctrl + D
Add all occurrences of the selected text to the selection: Alt + F3
Rotate between occurrences of selected text (single selection): Ctrl + F3 (reverse: Ctrl + Shift + F3)
Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: Ctrl + Shift + L
Mac OS X
Return to single selection mode: ⎋ (that's the Mac symbol for Escape)
Extend selection upward/downward at all carets: ⌃⇧⇡, ⌃⇧⇣ (See note)
Extend selection leftward/rightward at all carets: ⇧⇠/⇧⇢
Move all carets up/down/left/right and clear selection: ⇠, ⇡, ⇣, ⇢
Undo the last selection motion: ⌘U
Add next occurrence of selected text to selection: ⌘D
Add all occurrences of the selected text to the selection: ⌃⌘G
Rotate between occurrences of selected text (single selection): ⌥⌘G (reverse: ⌥⇧⌘G)
Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: ⇧⌘L
Notes for Mac users
On Yosemite and El Capitan, ⌃⇧⇡ and ⌃⇧⇣ are system keyboard shortcuts by default. If you want them to work in Sublime Text, you will need to change them:
Open System Preferences.
Select the Shortcuts tab.
Select Mission Control in the left listbox.
Change the keyboard shortcuts for Mission Control and Application windows (or disable them). I use ⌃⌥⇡ and ⌃⌥⇣. They defaults are ⌃⇡ and ⌃⇣; adding ⌃ to those shortcuts triggers the same actions, but slows the animations.
In case you're not familiar with Mac's keyboard symbols:
⎋ is the escape key
⌃ is the control key
⌥ is the option key
⇧ is the shift key
⌘ is the command key
⇡ et al are the arrow keys, as depicted
In Sublime Text, after you select multiple regions of text, a click is considered a way to exit the multi-select mode. Move the cursor with the keyboard keys (arrows, Ctrl+arrows, etc.) instead, and you'll be fine
Try using Ctrl-click on the multiple places you want the cursors. Ctrl-D is for multiple incremental finds.
I find using vintage mode works really well with sublime multiselect.
My most used keys would be "w" for jumping a word, "^" and "$" to move to first/last character of the line. Combinations like "2dw" (delete the next two words after the cursor) make using multiselect really powerful.
This sounds obvious but has really sped up my workflow, especially when editing HTML.
Mac Users, let me save you the time:
Cmd+a: select the lines you want a cursor
Cmd+Shift+l: to create the cursor
In PhpStorm, when dealing with soft/smart-tabs can I jump back to the previous tabstop with one key press or combo?
I tried Shift+Tab but it doesn't jump back to the tabstop, it jumps back by the size of the softtab.
Here is an illustration where a soft tab is 4 spaces:
Notabs (0 spaces)
••••Tabstop1 (1 Tab)
••••••••Tabstop2 (2 Tabs)
••••••* My cursors is here in between Tabstop 1 + 2
••••••••<- another Tab press moves me to Level2
••••<- I want to get here, back to Level1 (in one key press)
••<- Shift+Tab moves me here (back 4 full spaces, a full soft tab)
In retrospect I can live with just backspacing a 3 to 1 times, and use Shift+Tab when traversing a tabstop or more of distance, but I'm just curious if there is a direct analogy to the way the Tab key works for un-tabbing stuff.
There is a little combo: press Tab, then press Shift+Tab.
It is not in one key press, but it is regardless of number of spaces (1 or 2 or 3) you want to jump over. No need to calculate how many backspaces you need: every time press 2 times.