Ⅰ. 插件描述
A collection of django helper functionsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mjbrownie/django-helper-utils'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mjbrownie/django-helper-utils'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mjbrownie/django-helper-utils'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mjbrownie/django_helper.vim
Ⅳ. 文档说明
repo here: http://github.com/mjbrownie/django_helper.vim/tree/master
note. This is only tested on linux with python support. in my ~/.bashrc I have the following line which allows django modules to be imported
export DJANGO_SETTINGS_MODULE=settings
Resolve a url to a tag
Usage
for a given django url path
urlpatterns(
'/some/url/path', 'some.django.view.function_name'
)
:DUrlTag /some/relative/path/
will resolve the path to the function and then call
:tag function_name
You need to have an up to date tags file and the command might choke on
complicated views with lots of decorators etc.
:DClient /some/relative/path/
will dump the html in a scratch window split
if settings.py is in the root of the path this script will :set path+= all template directories including INSTALLED_APPS,
so you can 'gf' to template files