开发者

emacs python mode preferences

I 'm just starting to use Python, but I'm a very experienced emacs user. I'd trying to decide between python.el and python-mode.el (or any other equivalent mode people can suggest).

Currently I'm leaning strongly towards python-mode.el, mainly because it has a useful "indent-region" method...

However, there's a couple of features of C-mode that I seem to lack in both modes which is go to the next/previous function (c-beginning-of-defun) (this differs from py-goto-block-up in that 1) there is no py-goto-block-down开发者_运维知识库, and 2) you can use c-b.... to scroll up through multiple functions, but the py-.. only goes out levels)

Also, since C has braces, etc, it's easy to find the beginning/end of a current section. py-goto-block-up gives me the beginning of a block, but there is no equivalent for the end of the block...

thanks


There are C-M-a and C-M-e in python-mode. They go to start and end, respectively, of the current def or class. They're mapped to beginning-of-defun and end-of-defun by default.

There's also C-c C-u, which is mapped to python-beginning-of-block. My python-mode doesn't map python-end-of-block by default, but it's there too.


I find pdbtrack (part of python-mode.el) invaluable


current python-mode.el comes with a lot of finer grained commands resp. to block, statement, expression, partial-expression, class, def, line

with attributes of beg/end/copy/delete/execute

get it at

https://launchpad.net/python-mode


Don't forget there are two python.el files. One is the "old" one in Emacs now, and the other is by fgallina and will be in Emacs 24.2 when it's released. I'm not qualified to say if the new one is better than python-mode.el.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜