是否有一个 emacs 插件在侧 Pane 中列出模块中的所有方法。
我正在寻找一个具有键盘快捷键的插件来显示/隐藏当前打开的 python 模块文件中的所有方法。
最佳答案
我建议使用 elpy .
C-c C-o
运行 elpy-occur-definitions,它创建一个新缓冲区,其中包含所有类和函数签名的列表。
您可以使用 C-n
和 C-p
导航列表。
该模式适用于 next-error-follow 次要模式。
因此缓冲区内的 C-c C-f
可以跳转到所选的类或函数定义。
这是该缓冲区内容的示例:
8 matches for "^ *\(def\|class\) " in buffer: leveling_utils.py
11:def leveling(episodes_with_potential_associations_by_member):
26:def _apply_leveling(sorted_episodes):
41:def _set_non_chronic_associations(episode):
73:def _apply_sub_to_procedural_association(assoc):
94:def _set_chronic_associations(episode):
102:def _set_associations_for_self(episode):
118:def _set_to_actual(association):
122:def _log_actual_associations(member, leveled_episodes):
顺便说一句,它还有许多其他有用的功能,对我来说,使它成为 python 模式的必要补充。
关于python - 用于列出 python 模块中所有方法的 Emacs 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18479208/