问题
(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