Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text change 'Goto Line...' shortcut

Tags:

sublimetext3

(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" }
]
like image 359
p0lAris Avatar asked Nov 13 '15 04:11

p0lAris


People also ask

How do I move up a line in sublime?

To Move Lines Up / Down ⌥ + ⌘ + ↑ / ⌥ + ⌘ + ↓ (⇧ + CTRL + ↑ / ⇧ + CTRL + ↓ on Windows)

How do you jump to the End of a line in sublime?

On Windows, use “End” and “Home” keys to go to the end/beginning of a line. It should also be noted that what you're describing is the default behavior of ctrl-left/right for any application that edits text (word processor, text editor, etc…) for both Windows and Linux.


1 Answers

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.

like image 199
MattDMo Avatar answered Sep 28 '22 01:09

MattDMo