如何使用 Sublime Text 3 的鼠标地图设置?

如何使用 Sublime Text 3 的鼠标地图设置?

我在网络上的各个地方找到了关于如何使用“.sublime-mousemap”文件的零散信息,但没有全面的信息。

为 Sublime Text 3 指定鼠标设置时有哪些选项?

答案1

虽然这并不能完全解决您的问题,但我至少可以建议查看默认鼠标地图以获得一些学习价值。

如果它在你的文件系统中不容易找到(就像我的情况一样),我成立有一个包资源查看器插件,您可以通过以下方式打开它:

Ctrl+Shift+P->“PackageResourceViewer:打开资源”->“默认”->“默认(...操作系统....sublime-鼠标地图”。

答案2

在 Windows 10 上,我可以覆盖默认设置C:\Users\Cees.Timmerman\AppData\Roaming\Sublime Text 3\Packages\User\Default (Windows).sublime-mousemap

保存该文件后,Sublime 将使用它,如果语法错误则显示错误消息。

如果链接失效,则默认内容如下:

[
    // Basic drag select
    {
        "button": "button1", "count": 1,
        "press_command": "drag_select_callback"
    },
    {
        "button": "button1", "count": 1, "modifiers": ["ctrl"],
        "press_command": "drag_select_callback",
        "press_args": {"additive": true}
    },
    {
        "button": "button1", "count": 1, "modifiers": ["alt"],
        "press_command": "drag_select_callback",
        "press_args": {"subtractive": true}
    },

    // Select between selection and click location
    {
        "button": "button1", "modifiers": ["shift"],
        "press_command": "drag_select_callback",
        "press_args": {"extend": true}
    },
    {
        "button": "button1", "modifiers": ["shift", "ctrl"],
        "press_command": "drag_select_callback",
        "press_args": {"additive": true, "extend": true}
    },
    {
        "button": "button1", "modifiers": ["shift", "alt"],
        "press_command": "drag_select_callback",
        "press_args": {"subtractive": true, "extend": true}
    },

    // Drag select by words
    {
        "button": "button1", "count": 2,
        "press_command": "drag_select_callback",
        "press_args": {"by": "words"}
    },
    {
        "button": "button1", "count": 2, "modifiers": ["ctrl"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "words", "additive": true}
    },
    {
        "button": "button1", "count": 2, "modifiers": ["alt"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "words", "subtractive": true}
    },

    // Drag select by lines
    {
        "button": "button1", "count": 3,
        "press_command": "drag_select_callback",
        "press_args": {"by": "lines"}
    },
    {
        "button": "button1", "count": 3, "modifiers": ["ctrl"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "lines", "additive": true}
    },
    {
        "button": "button1", "count": 3, "modifiers": ["alt"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "lines", "subtractive": true}
    },

    // Shift + Mouse 2 Column select
    {
        "button": "button2", "modifiers": ["shift"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "columns"}
    },
    {
        "button": "button2", "modifiers": ["shift", "ctrl"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "columns", "additive": true}
    },
    {
        "button": "button2", "modifiers": ["shift", "alt"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "columns", "subtractive": true}
    },

    // Mouse 3 column select
    {
        "button": "button3",
        "press_command": "drag_select_callback",
        "press_args": {"by": "columns"}
    },
    {
        "button": "button3", "modifiers": ["ctrl"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "columns", "additive": true}
    },
    {
        "button": "button3", "modifiers": ["alt"],
        "press_command": "drag_select_callback",
        "press_args": {"by": "columns", "subtractive": true}
    },

    // Simple chording: hold down mouse 2, and click mouse 1
    {
        "button": "button1", "count": 1, "modifiers": ["button2"],
        "command": "expand_selection", "args": {"to": "line"},
        "press_command": "drag_select_callback"
    }
]

相关内容