Emacs - 局部 Python 变量的制表符补全 [英] Emacs - tab-completion of local Python variables

查看:28
本文介绍了Emacs - 局部 Python 变量的制表符补全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种好的 emacs 模式可以允许对本地 python 变量进行制表符补全?我设置了 ipython.el 但它只会在解释器的范围内完成选项卡.我正在寻找可以让我在函数或文件的本地命名空间中使用制表符完成标记的东西.

Is there a good emacs mode that will allow tab-completion of local python variables? I set up ipython.el but it will only tab-complete things in the scope of the interpreter. I'm looking for something that will let me tab-complete tokens in the local namespace of a function or file.

推荐答案

M-/运行命令 dabbrev-expand .这将在任何模式下完成本地名称.此外,我将 meta f1 绑定到所有打开的缓冲区中的嬉皮扩展.这对我很有用.

M-/ runs the command dabbrev-expand . This will complete local names in any mode. Also I bind meta f1 to hippie expand from all open buffers. This is very useful for me.

;; Bind hippie-expand
(global-set-key [(meta f1)] (make-hippie-expand-function
                               '(try-expand-dabbrev-visible
                                 try-expand-dabbrev
                                 try-expand-dabbrev-all-buffers) t))

希望这有用.

这篇关于Emacs - 局部 Python 变量的制表符补全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆