Emacs python-mode:pdb 逐步调试的键盘快捷键

发布于 2025-01-03 11:20:28 字数 390 浏览 7 评论 0原文

我想知道是否有一种方法可以关联:

  • n RET(下一个)
  • p RET(上一个)
  • c RET(继续)
  • Cx SPC RET(设置/清除断点)

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

python-mode 是否已支持此功能? 是否有任何 Emacs 模式可用于补充 python-mode 以进行调试?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你如我软肋 2025-01-10 11:20:28

您始终可以在 Emacs 中定义自己的键绑定。首先输入 Ch m 查看 pdb 缓冲区中模式的帮助(以 Mx pdb 开头)。

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

(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 手册(输入 Ch i g (emacs) Debuggers< /kbd> RET) 或在线:

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文