The only way to make a multiline cursor in Sublime text 3 is Ctrl+Shift+RC+Drag. Is there any way to do this without using a mouse?
7 Answers
Yes, there is. Using Shift↓ or Shift↑, select the lines you want multiple cursors on. Next, hit CtrlShiftL (CommandShiftL on macOS) to split the selection into lines. Finally, hitting ← will put the cursors at the beginning of the lines, while → will put them at the end.
Edit
There is also another, quicker way (thanks to minitech) - CtrlAlt↑/↓ will create multiple cursors without having to do selections first, and you can place the cursors anywhere in the line you wish. However, on Windows these key combos may be mapped to changing the screen orientation. To change this, hit CtrlAltF12 to open the Intel control panel, click Options
, and either remap the screen orientation hotkeys, or click Off
on the left side to disable all of them.
-
3Another way is to place the cursor at the end of the first line,
Shift →
to select the new line character, andCtrl D
to select following new lines.– grcCommented Oct 1, 2014 at 15:06 -
@grc true, but then you have all the newlines selected, and they will be deleted as soon as you start typing.– MattDMoCommented Oct 1, 2014 at 15:08
-
You can unselect with any arrow key like you mention in your answer.– grcCommented Oct 1, 2014 at 15:10
-
The first way works but is quirky - the first line cursor didn't go to the line start in my case although the following cursors did. The second way did nothing on my system until I have disabled the Intel Graphics hot keys the way you recommend (they didn't work anyway). It seems the best way for me. @grc's suggestion works great.– IvanCommented Oct 1, 2014 at 15:42
-
1
You can use Middle mouse button for this as well.
Click & Hold Middle mouse button and drag up and down
Standard key bindings not work for me(Ubuntu 16.4 and Win 10), but after redefining works good! To redefine default key bindings use (Preferences->Key Bindings)
{ "keys": ["alt+shift+down"], "command": "select_lines", "args":{"forward": true} }
will add cursor below, { "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} }
will add cursor above.
-
This works for me on window 10 on a Surface Pro. I prefer not having to use a mouse most of the time, if possible. The last answer should not be selected as the question was asking specifically about how to do it without a mouse.– SarahCommented Jan 25, 2020 at 22:13
MAC: ctrl ( ^ ) + Shift + up / down arrow
ctrlShiftup arrow
ctrlShiftdown arrow
-
1Can confirm, this works for me on macOS Mojave, where the accepted answer does not.– tmastnyCommented Jun 4, 2020 at 14:17
-
1
-
This moves the line where the cursor is up and down for me. Is there a setting string to ensure what you describe is the behavior for the key chord you list?– ruffinCommented Sep 5, 2023 at 17:50
What works for me on a window 10 Surface Pro is
Ctrl + Alt + up/down
Because Ctrl + Alt + up/down already works for me, there is no need to do another key binding. I have it set up the same way for VS Code as well: Ctrl + Alt + up/down.
Or you can also map it as Yaroslav says (which I voted up), which works as well.
It was much simpler for me than any other answers above: Just hold ctrl
and click on your mouse placing it where you want to have the second or third cursor.
-
Hey, welcome to StackOverflow! This would be a useful answer, except that the OP said "without a mouse". Don't feel badly! Easy to delete this one and answer another.
;^D
– ruffinCommented Sep 5, 2023 at 17:49
Ctrl-Alt-F12
to open the Intel control panel, go to options, and either remap the screen orientation keys, or clickOff
and disable them all together.