没有开始 tabs/spaces 和字符串结尾的 Sublime text select 行

Sublime text select line without start tabs/spaces and end of string

如您所知,您可以使用热键 ctrl + L (linux ubuntu) 在光标下 select 行。但是 selected 文本包含起始空格或制表符,并在末尾包含 \n。 我如何 select 没有空格或制表符的行?

将以下 sublime-macro 保存到:
Packages/MyMacroFolder/Select LineText.sublime-macro

[
    {
        "command": "move_to",
        "args": { "extend": false, "to": "eol" }
    },
    {
        "command": "move_to",
        "args": { "extend": true, "to": "bol" }
    }
]

通过 运行 Preferences: Key Bindings - Usercommand palette 打开您的用户 sublime-keymap 文件。

Select LineText.sublime-macro 添加一个 key-binding

{
    "keys": [ "ctrl+shift+alt+l" ],
    "command": "run_macro_file",
    "args": { "file": "res://Packages/MyMacroFolder/Select LineText.sublime-macro" },
},

您现在可以使用您在 sublime-keymap 中分配的任何键绑定 select 行文本( 不包括前导和尾随空格 )。

示例中的键绑定是Ctrl + Shift + Alt + L