Sublime Text 3 Windows column selection with Alt?

*爱你&永不变心* 提交于 2019-12-11 02:53:54

问题


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?


回答1:


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"}
  },
]



回答2:


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



来源:https://stackoverflow.com/questions/27788304/sublime-text-3-windows-column-selection-with-alt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!