Emacs里面的Python mode(python.el)

11 篇文章 0 订阅

References: http://python.about.com/b/2007/09/24/emacs-tips-for-python-programmers.htm


Emacs is one of the most powerful  Python editors available today. It runs on every major platform (and many minor ones) and makes editing very easy. Aside from being scriptable in Python, Emacs' Python mode comes with a plethora of shortcuts to make Python programming easier on your hands and your head. It starts up automatically whenever you open a Python program in Emacs. Here is a brief summary of Emacs' Python mode  (Update of 29 May 2008: Per Dave Turvene's comment, it is worth noting that these bindings are from the Python mode proferred by the PSF and available at  http://sourceforge.net/projects/python-mode/ ):
  • C-j: Insert a new line with the same indentation level as the current line
  • RET: Insert a new line with the same indentation level as the current line
  • C-M-a: Go to the beginning of the current function or class
  • C-M-e: Go to the end of the current function or class
  • C-M-h: Mark the current function or class for copying, etc.
  • C-M-x: Execute the current function or class
  • C-c C-b: Submit a bug report
  • C-c C-c: Execute the buffer (i.e., the file being displayed)
  • C-c C-d: Trace the stack of the process being executed
  • C-c C-h: Get context-based help
  • C-c TAB: Indent a highlighted (or marked) region
  • C-c C-k: Mark a block of text. Using this at the head of a class or function definition will mark the entire block.
  • C-c C-l: Shift the region to the left. If the cursor is in the middle of a region, the lower half of the region will shift.
  • C-c RET: Execute the current file, opening a new window to show the output.
  • C-c C-n: Jump to the next statement.
  • C-c C-p: Jump to the previous statement.
  • C-c C-r: Shift the region to the right. If the cursor is in the middle of a region, the lower half of the region will shift.
  • C-c C-s: Execute a Python command.
  • C-c C-t: Toggle shells
  • C-c C-u: Go up one block
  • C-c C-v: List the version of the Python mode
  • C-c C-w: Run PyChecker
  • C-c !: Open the Python interactive shell
  • C-c #: Comment the highlighted (marked) region
  • C-c :: Check the indentation off-set
  • C-c <: Shift the region to the left
  • C-c >: Shift the region to the right
  • C-c ?: Show Python mode documentation
  • C-c |: Execute the highlighted (marked) part of the current program.
Note that Python mode for Emacs offers more functionality than this, but these are the basics. If you know Emacs from editing other languages, learning your way around the Python mode is a snap.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值