python - 用于列出 python 模块中所有方法的 Emacs 插件

标签 python emacs

是否有一个 emacs 插件在侧 Pane 中列出模块中的所有方法。

我正在寻找一个具有键盘快捷键的插件来显示/隐藏当前打开的 python 模块文件中的所有方法。

最佳答案

我建议使用 elpy .

C-c C-o 运行 elpy-occur-definitions,它创建一个新缓冲区,其中包含所有类和函数签名的列表。

您可以使用 C-nC-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/

相关文章:

Python:在所有元素的二维数组中显示索引

python - 如何将小部件放入选项卡中以控制选项卡中的绘图

python - 如果您有数字间隔,请计算分组中位数

python - 如何在Python中有效计算(稀疏)位矩阵上的矩阵乘积

python - 使用 python 获取屏幕上文本的 x , y 坐标

emacs - 在Emacs中,如何在Finder中显示当前文件?

emacs - 在 org-babel 的结果 block 中启用字体粗细和颜色

emacs - 看不见的 mailto : in org mode email links?

c - emacs gdb 跳转到光标

emacs - GNU emacs : setting keybindings to highlight text with shift key