Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3 Windows column selection with Alt?

Shift + right-click feels unintuitive to me.

How can I tell ST3 to allow Alt + drag to do column selection, like in many other programs?

like image 953
Patrick Avatar asked Dec 30 '25 08:12

Patrick


2 Answers

I got this to work on Windows 7 using Sublime Text 3.

I created a file "C:\Users\\AppData\Roaming\Sublime Text 3\Packages\User\Default (Windows).sublime-mousemap", and put this in it:

[
  {
    "button": "button1","modifiers": ["alt"],
    "press_command": "drag_select",
    "press_args": {"by": "columns"}
  },
]
like image 90
dwn Avatar answered Jan 02 '26 06:01

dwn


The accepted answer by dwn is correct, but it is not complete answer.
This is more complex, because sometimes you need select two columns or just unselect some.
You need something like this:

[
    {
        "button": "button1", "modifiers": ["alt"],
        "press_command": "drag_select",
        "press_args": {"by": "columns"}
    },
    {
        "button": "button1", "modifiers": ["alt", "shift"],
        "press_command": "drag_select",
        "press_args": {"by": "columns", "additive": true}
    },
    {
        "button": "button1", "modifiers": ["alt", "ctrl"],
        "press_command": "drag_select",
        "press_args": {"by": "columns", "subtractive": true}
    }
]

Tested on Win 7 and Sublime Text 3

like image 21
kanlukasz Avatar answered Jan 02 '26 05:01

kanlukasz