rob*_*nce 7 python vim numpy omnicomplete
我在vim中使用pythoncomplete omnicompletion.当我直接实例化类时,它很有用,例如
import numpy as np
x = np.ndarray(l)
Run Code Online (Sandbox Code Playgroud)
然后x属性正确完成.
但我使用numpy和matplotlib所以通常使用工厂函数,即
x = np.zeros((2,2))
f = plt.figure()
ax = f.add_subplot(111)
Run Code Online (Sandbox Code Playgroud)
有没有什么方法可以硬编码这些常用函数的返回类型,以便我可以完成返回的对象.(即设置一些映射,matplotlib.pyplot.figure返回matplotlib.figure.Figure,np.zeros返回np.ndarray等?
尝试jedi-vim。
您面临的问题有一个悬而未决的问题。我认为它很有可能在 3-4 个月内得到修复: https: //github.com/davidhalter/jedi/issues/372。
Jedi 也是YouCompleteMe和几乎所有其他不错的 Python 自动完成插件背后使用的库。