Emacs python模式:pdb的键盘快捷键一步一步的调试 [英] Emacs python-mode: Keyboard shortcuts for pdb step-by-step debugging

查看:286
本文介绍了Emacs python模式:pdb的键盘快捷键一步一步的调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法联系:




  • n RET (下)

  • p RET (previous)

  • c RET (继续)

  • Cx SPC RET(设置/清除断点)



带功能键 F1 - F12 或其他键盘快捷键。这个想法是模拟其他IDE用于调试的键盘快捷键(例如Visual Studio,MATLAB等)。



这是由$ code支持的> python-mode?是否有任何Emacs模式可用于补充 python-mode 用于调试目的?

$ b $你可以在Emacs中定义自己的键绑定。首先键入 Ch m 以查看pdb缓冲区中的模式(从 Mx pdb 开始)的模式。 p>

接下来绑定任何键盘组合:

 
(require'gud)
(define-key gud-mode-map'[f11]'gud-step)
(define-key gud-mode-map'[f10]'gud-next)
(define-key gud- mode-map'[f5]'gud-cont)
(define-key gud-mode-map'[f12]'gud-break)

阅读Emacs关于调试器的内置接口的手册(t (emacs)调试器 p>

http: //www.gnu.org/software/emacs/manual/html_node/emacs/Debuggers.html


I was wondering if there is a way to associate:

  • n RET (next)
  • p RET (previous)
  • c RET (continue)
  • C-x SPC RET (set/clear breakpoint)

with function keys F1-F12 or other keyboard shortcuts. The idea is to emulate the keyboard shortcuts that other IDEs have for debugging (e.g. Visual Studio, MATLAB, etc.).

Is this already supported by python-mode? Are there any Emacs modes that can be used to complement python-mode for debugging purposes?

解决方案

You always can define own key-bindings in Emacs. Firstly type C-h m to see help on mode in pdb buffer (which start by M-x pdb).

Next bind any keyboard combination:

(require 'gud)                                                                                                                                                
(define-key gud-mode-map '[f11] 'gud-step)                                                                                                                    
(define-key gud-mode-map '[f10] 'gud-next)                                                                                                                    
(define-key gud-mode-map '[f5] 'gud-cont)                                                                                                                     
(define-key gud-mode-map '[f12] 'gud-break) 

Read Emacs manual about build-in interface to debuger (type C-h i g (emacs) Debuggers RET) or online:

http://www.gnu.org/software/emacs/manual/html_node/emacs/Debuggers.html

这篇关于Emacs python模式:pdb的键盘快捷键一步一步的调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆