
If it doesn’t work you can check out my dotfiles repo and use them as personal files or guide. Then test the autocomplete with some functions, launch it with the Tab key. Test djvim with: djvim myproject models.pyĪnd inside Vim type: :python from django import db Then make the file executable and move it to your /bin folder, that will do the trick. Paste this lines inside a file called djvim (DON'T FORGET TO MODIFY YOUR PROJECT PATH): PROJECT_PATH="/home/marin/Code"Įxport DJANGO_SETTINGS_MODULE=$1.settings Now we will be able to define or little wrapper which I built based on a few examples that I found over the internet, those examples were not working for me but once I understood the idea it was very easy to code.
let g:SuperTabDefaultCompletionType 'To get supertab to use omnicompletion by default you can add the following line to your vimrc. Close vim's completion preview window when code completion is finished.
PreventConfigurable to suit your needs: Default completion type to use.
Let g:SuperTabDefaultCompletionType = "context"įirst lines are activating the Omni Completion feature of Vim for those type of files and the last lines are very helpful and comfortable to work with Super Tab which must be inside of our. To get supertab to use omnicompletion you need to either use
vimrc: "-ENABLE PYTHON/DJANGO OMNICOMPLETEĪutocmd FileType python set omnifunc=pythoncomplete#CompleteĪutocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJSĪutocmd FileType html set omnifunc=htmlcomplete#CompleteTagsĪutocmd FileType css set omnifunc=csscomplete#CompleteCSS So, if you are like me and love Vim a simple wrapper will transform Vim into a more powerful tool to work with Django and Python, but before we set up the wrapper we have to configure some things inside or. On this came back many of my friends suggested P圜harm as the right tool to use but I just can’t work with an IDE, it just doesn’t feel smooth and fast as Vim. I recently came back on Django development and after a year my own set of coding tools had changed a lot, mainly because Vim became my main text editor.
