Sublime Text change 'Goto Line…' shortcut

血红的双手。 提交于 2019-12-21 17:03:23

问题


(This question is specifically for the Mac, but you may enlighten Windows users if you want!)

What is the command for 'Goto Line...' to change the shortcut as it's down for 'Goto Definition...' like below:

[
    { "keys": ["cmd+D"], "command": "goto_definition" }
]

回答1:


You can find out what command is being executed by opening the console (Ctrl`) and entering

sublime.log_commands(True)

Keeping the console open, select Goto -> Goto Line... or hit the key combo CtrlG, and the following appears:

command: show_overlay {"overlay": "goto", "text": ":"}

Therefore, the keymap definition would be:

{ "keys": ["ctrl+g"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }

You can change the "ctrl+g" to whatever you want in your user key bindings.



来源:https://stackoverflow.com/questions/33686238/sublime-text-change-goto-line-shortcut

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