Is rails.vim the equivalent of Django?

I like Tim Papa rails.vim and I wonder if there is an equivalent vim plugin for Django. I am especially looking for convenient navigation through the Django file structure via vim command line mode.

+4
source share
5 answers

I am using django.vim for Django templates

+3
source

There is nothing structured in this plugin.

Regarding quick navigation, I have this in my vimrc

http://code.djangoproject.com/wiki/UsingVimWithDjango#Mappings (the whole document will give you good starting points)

I also posted a couple of suggestions on vim.org for some navigation tasks

http://www.vim.org/scripts/script.php?script_id=2781 (for return URL and template)

http://www.vim.org/scripts/script.php?script_id=2780 (import completion)

In addition to this general purpose, vim fu can go a long way.

+2
source

I created a repo to add many branches for vim configuration (django / python centric). There are already several branches and path hacking for settings.py. Feel free to fork / share and share!

http://github.com/skyl/vim-config-python-ide

I am not going to add nerdtree, but I think this is a really popular file browser plugin.

+1
source

The django wim page on using vim now contains the pony.vim plugin, which seems to give similar rails.vim stuff, including the ability to jump between models, views, templates, etc. to the application, and also run some django commands directly from inside vim. Part of this is that, quite simply, the django folder structure is different from Rails (less complex? / Less defined? / Of course, different ethics in general). But pony.vim looks like it covers most of the databases.

rope-vim can make improvements easier, although it requires only a small part of the settings, and also adds direct access to documents for autocompletion, which is pretty nice.

(I answer this here because it is the best result on Google when looking for the rails.vim equivalent for Django: P)

+1
source

** Update 10/8/2013 **

Now I am using jedi-driven vyth vim configuration (along with some tmux configuration)

https://github.com/JarrodCTaylor/imt_dotfiles


I also have a pretty complete vim configuration for django development (if you're interested).

https://github.com/toranb/vimfiles

I use rope-vim as mentioned by others, but I also have some other useful plugins so you can run unit tests (using the nose) in a django project with QTPY

A few things that I came across are that others, as a rule, are not mentioned when developing python / django on OSX and Ubuntu (dev / night time dev / dev), including:

https://github.com/lambdalisue/vim-django-support

https://github.com/jmcantrell/vim-virtualenv

If you make sure that vim has activated virtualenv (assuming you use virtualenv), the plugin will know where to find the packages for your site to quickly "go to definition" along with other refactoring support.

I use this without any need for pycharm, since I get full completion with rope-vim and supertab. I also have a command-t plugin to quickly find "find by file" / etc

I recently discovered that using basic ctags on OSX + Ubuntu allowed me to “find a character” using the below. I also added a simple search for “recent files” using find in the buffer. I also added some shortcuts to show a fuzzy search, for example, a search from the current directory (for a file that I think is open). I use this to quickly show other related / etc files.

find by equiv symbol (shows classes / methods in fuzzy finder using your ctags file)

 :FufTag 

find in buffer (latest files)

 :FufBuffer 

show fuzzy search with other files in the current directory

 :FufFileWithCurrentBufferDir 
0
source

All Articles