Multiple cursors in Sublime Text under Ubuntu

Shift+Right Mouse Button is the combination for column selection in Linux.


Alt+Shift+Up Will Add a new cursor on the line above the current one

Alt+Shift+Down Will Add a new cursor on the line under the current one


  • Ctrl + Mouse1Click will set another cursor at the location of the click.

  • Ctrl + D will highlight the current word, move the cursor to its end, and add another highlight and cursor at the next occurence of that word. Repeated presses will select additional occurences.


Using/enabling "multi-cursor", "select lines", or "column selection" mode in Sublime Text 3

  1. As @bruha says, Shift + Right-mouse-click and drag up or down works.
  2. As @russianPopsv says, these should work on Ubuntu too:
    1. Alt+Shift+Up
    2. Alt+Shift+Down

In my case, however, on two Ubuntu 18.04 machines Alt+Shift+Up worked just fine, but on a third one it wouldn't work at all! I have no idea why. How do I fix it?

If it doesn't work for you, then do this:

In Sublime Text 3, go to Preferences --> Key Bindings. Search the left screen for select_lines. There are two matches, here:

enter image description here

They contain these JSON configuration lines:

{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },

So, copy those into your personal settings screen on the right, so it looks like this. If you have other settings there already, be sure to keep those too.

[
    { "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
    { "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },
]

Now save (Ctrl + S) and exit these keyboard settings by closing the window. That's it! The keyboard shortcuts will work now. I don't know why we had to do this, as they should have worked by default already, but somehow this fixed it, so whatever, it's good enough for me.

Where did I originally learn how to use multi-cursor ("column selection") mode in Sublime Text? Answer: Sublime Tutor

I originally learned this "column selection", or "multi-cursor" mode from Sublime Tutor (https://sublimetutor.com/). It is described in chapter_3_2.md, as shown here:

enter image description here

It will help you master Sublime Text in no time! It's super super easy to install:

(See: https://packagecontrol.io/packages/Sublime%20Tutor):

Installation

Via Package Control:

  1. Install Package Control if already not installed: https://packagecontrol.io/installation#st3
  2. Press Cmd+Shift+P to bring command palette in front
  3. Type Install Package and press enter.
  4. Search for Sublime Tutor and press enter to install the plugin.

I highly recommend it.