Ⅰ. 插件描述
jump between template, view, url in django projectⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/djangojump'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/djangojump'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/djangojump'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/djangojump
Ⅳ. 文档说明
description
vim-djangojump plugin is used for
jumping between url, view function and
template immediately.
note: now open vim at django project's
root path where has settings.py file
email: itachi.akatuki.sh@gmail.com
tip:
- url => view function
:DUrltoview /app1/overview/ - view function ==> template file
:DViewtotpl (at line which contains
template's name)
example code:
....
(*) return render_to_response(\"index.html\")
cursor at this line(*) and call command
:DViewtotpl
- template file ==> view function
:DTpltoview - js which template includes ==> js source file
css which template includes ==> css source file
:DGotoscript
- reload cache
:DReloadCache - url ==> template file
:DUrltotpl /xxx/yyy/
install details
linux platform is ok, it's not tested under windows platform, maybe it can work correctly.
- copy djangojump.vim to ~/.vim/plugin/ folder
- open vim at django project root folder, then you can use these commands
note: this plugin need python2.6+ support, at first opening vim, it would be slow, but after it would work normally.
hotkeys
template ==> view function
nmap <c-d><c-t> :DTpltoview<CR>
view function ==> view
nmap <c-d><c-v> :DViewtotpl<CR>
url ==> view function
nmap <c-d><c-u> :DUrltoview
template ==> script(js, css)
nmap <c-d><c-s> :DGotoscript<CR>
reload cache if add file or remove file
nmap <c-d><c-r> :DReloadCache<CR>
url ==> template file
nmap <c-d><c-i> :DUrltotpl<CR>