Does anyone know how to set up auto completion to work nicely with python, django, and vim?
I\'ve been trying to use pysmell, but I can\'t seem to get it set up corr
Today, you not need special extentions for django autocomplete in vim. Make sure that you have vim with python support. To check it, type in xterm:
vim --version|grep python
+python -python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs ... ...
To make work autocomplete, add this lines in your .vimrc:
autocmd FileType python set omnifunc=pythoncomplete#Complete
if has("python")
python import sys,os
python sys.path.append('/home/sergey/workspace/django')
python os.environ['DJANGO_SETTINGS_MODULE'] = 'djangoProject.settings'
endif
where:
Finally, save it and restart vim. Now, after '.', you press default ctrl-x ctrl-o to get your autocomplete.