Wednesday, June 19, 2013

Column selection in Sublimetext using alt + left click

Many editors use alt + left click to do column selection. In Sublimetext the default is middle mouse button or shift + right click. To use alt + left click, create a file Data\Packages\User\Default (Windows).sublime-mousemap (or equivalent if different OS), with the following contents:
[
 {
  "button": "button1", "modifiers": ["alt"],
  "press_command": "drag_select",
  "press_args": {"by": "columns"}
 },
 {
  "button": "button1", "modifiers": ["alt", "ctrl"],
  "press_command": "drag_select",
  "press_args": {"by": "columns", "additive": true}
 }
]