Question

I want to change the key bindings for XDebug plugin in Sublime Text 3. How I can change the key binding for Run, Step over, Step into, Step out, etc.?

Was it helpful?

Solution

This answer is a more complete answer from user2968356.

To complete this answer, the .sublime-package file is an archive, so it can be decompressed using a ZIP utility. It's not necessary to edit the Default.sublime-keymap in the package, we can copy the key bindings and add it modified to Default.sublime-keymap available from Preferences -> Key Bindings - User in Sublime Text.

And to provide a shortcut, here's the default key binding of XDebug package, modify at will:

{"keys": ["ctrl+f8"], "command": "xdebug_breakpoint"},
{"keys": ["shift+f8"], "command": "xdebug_conditional_breakpoint"},
{"keys": ["ctrl+shift+f5"], "command": "xdebug_continue", "args": {"command": "run"}},
{"keys": ["ctrl+shift+f6"], "command": "xdebug_continue", "args": {"command": "step_over"}},
{"keys": ["ctrl+shift+f7"], "command": "xdebug_continue", "args": {"command": "step_into"}},
{"keys": ["ctrl+shift+f8"], "command": "xdebug_continue", "args": {"command": "step_out"}},
{"keys": ["ctrl+shift+f9"], "command": "xdebug_session_start"},
{"keys": ["ctrl+shift+f10"], "command": "xdebug_session_stop"},
{"keys": ["ctrl+shift+f11"], "command": "xdebug_layout", "args": {"keymap" : true}}

OTHER TIPS

Go to Preferences -> Browse Packages... in the sublime menu.

This will open the Packages folder. Go back one folder and you should see another folder called Installed Packages.

Find the .sublime-package for xdebug usually named accordingly to the package name you installed via package control.

Inside you find a Default.sublime-keymap file that holds all the key bindings.

Change to your needs, save and restart sublime.


Cheers, hope this helps!

For Max users, you may want to replace 'ctrl' with 'super', which is the command key. Followings are my settings:

[
    {"keys": ["super+f16"], "command": "xdebug_breakpoint"},
    {"keys": ["shift+f16"], "command": "xdebug_conditional_breakpoint"},
    {"keys": ["super+shift+f5"], "command": "xdebug_continue", "args": {"command": "run"}},
    {"keys": ["super+f13"], "command": "xdebug_continue", "args": {"command": "step_over"}},
    {"keys": ["super+f14"], "command": "xdebug_continue", "args": {"command": "step_into"}},
    {"keys": ["super+f15"], "command": "xdebug_continue", "args": {"command": "step_out"}},
    {"keys": ["super+shift+f9"], "command": "xdebug_session_start"},
    {"keys": ["super+shift+f17"], "command": "xdebug_session_stop"},
    {"keys": ["super+shift+f18"], "command": "xdebug_layout", "args": {"keymap" : true}}
]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top