【发布时间】:2014-01-15 16:18:01
【问题描述】:
我想在 Sublime Text 3 中更改 XDebug 插件的键绑定。如何更改 Run、Step over、Step into 的键绑定、走出去等?
【问题讨论】:
标签: xdebug sublimetext3
我想在 Sublime Text 3 中更改 XDebug 插件的键绑定。如何更改 Run、Step over、Step into 的键绑定、走出去等?
【问题讨论】:
标签: xdebug sublimetext3
这个答案比较完整answer from user2968356。
为了完成这个答案,.sublime-package 文件是一个存档,因此可以使用 ZIP 实用程序对其进行解压缩。不需要编辑包中的Default.sublime-keymap,我们可以复制键绑定并将其添加到修改后的Default.sublime-keymap Preferences -> Key Bindings - User在崇高的文本中。
并且提供快捷方式,这里是XDebug包的默认按键绑定,随意修改:
{"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}}
【讨论】:
在 sublime 菜单中转到 Preferences -> Browse Packages...。
这将打开Packages 文件夹。返回一个文件夹,您应该会看到另一个名为 Installed Packages 的文件夹。
找到 xdebug 的.sublime-package,通常根据您通过包控制安装的包名称命名。
您会在其中找到一个包含所有键绑定的Default.sublime-keymap 文件。
根据您的需要更改,保存并重新启动 sublime。
干杯,希望这会有所帮助!
【讨论】:
对于 Max 用户,您可能希望将“ctrl”替换为“super”,即命令键。以下是我的设置:
[
{"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}}
]
【讨论】: