djangojump


Ⅰ. 插件描述

jump between template, view, url  in django project

Ⅱ. 基本信息

创建日期:  2012-10-06
使用用户:  1
Github星:  1
插件作者:  hello world

Ⅲ. 安装方法

使用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:

  1. url => view function
       :DUrltoview /app1/overview/
  2. 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

  1. template file ==> view function
       :DTpltoview
  2. js which template includes ==> js source file
       css which template includes ==> css source file

   :DGotoscript

  1. reload cache
       :DReloadCache
  2. url ==> template file
       :DUrltotpl /xxx/yyy/

install details

linux platform is ok,  it's not tested under windows platform, maybe it can work correctly.

  1. copy djangojump.vim to ~/.vim/plugin/ folder
  2. 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>

添加新评论