更新时间:2023-08-26 14:52:28
首先,感谢您提出这个问题,因为它迫使我自己解决这个问题,这很棒!
First off, thank you for asking this question, as it forced me to figure this out myself and it's great!
这是我用作参考的页面:PySmell v0.6 发布:orestis.格
Here is the page I used as a reference: PySmell v0.6 released : orestis.gr
setup.py install
命令安装 PySmell.site-packages/django
目录并运行: pysmell ,为 django 生成 PYSMELLTAGS
文件.-o ~/PYSMELLTAGS.django
pysmell .
以生成项目 PYSMELLTAGS 文件PYTHONPATH
中(export PYTHONPATH=${PYTHONPATH}:/path/to/pysmell/
)vim .
)pysmell.vim
(:source/path/to/pysmell/pysmell.vim
):set omnifunc=pysmell#Complete
)setup.py install
command.PYSMELLTAGS
file for django by going to your site-packages/django
directory and running: pysmell . -o ~/PYSMELLTAGS.django
pysmell .
to generate the project PYSMELLTAGS filePYTHONPATH
(export PYTHONPATH=${PYTHONPATH}:/path/to/pysmell/
)vim .
)pysmell.vim
(:source /path/to/pysmell/pysmell.vim
):set omnifunc=pysmell#Complete
)我意识到这不是一个可持续的解决方案,但是您应该能够使用它作为开始设置以使其始终工作(例如,将导出添加到您的 .bashrc,将 :source 添加到您的 .vimrc,setup autocmd FileType python set omnifunc=pysmell#Complete
等)
I realize this is not a sustainable solution, but you should be able to use this as a start to getting it setup to always work (e.g., add the export to your .bashrc, add the :source to your .vimrc, setup autocmd FileType python set omnifunc=pysmell#Complete
, etc.)
让我知道这是否足以让您入门.它对我有用!
Let me know if this is enough to get you started. It worked for me!
编辑我只是将它添加到我的 .vimrc 中,并且只要 PYSMELLTAGS
&PYSMELLTAGS.django
文件位于我的项目根目录中,无需任何其他工作即可正常工作:
Edit
I simply added this to my .vimrc and as long as the PYSMELLTAGS
& PYSMELLTAGS.django
files are in my project root, it works fine without any other work:
python << EOF
import os
import sys
import vim
sys.path.append("/usr/local/python/lib/python2.5/site-packages")
EOF
exe ":source ~/src/pysmell/pysmell.vim"
autocmd FileType python set omnifunc=pysmell#Complete