Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在emacs中为python代码提高一个缩进级别?
def foo(): ... def bar(): # if I'm here, is there a way to go to def foo? pass
使用 python-mode.el 调用M-x py-up RETresp。C-M-u
它会先跳到“def bar”的开头,然后再向上调用。
它的文档字符串说:
(py-up &可选的缩进)
如果在里面,则向上或到表格的开头。
如果在分隔形式 -- 字符串或列表内 -- 转到它的开头。
如果不在语句或块的开头,则转到它的开头。
如果在语句或块的开头,则转到复合语句或定义的上一级的开头。