Skip to content
Browse files

Version 1.2: add hotkey

  • Loading branch information...
1 parent ee62507 commit 89a6a50549e9b4d6410302ed8797c638acc57d93 zack shen committed with
Showing with 28 additions and 1 deletion.
  1. +20 −1 doc/djangojump.txt
  2. +8 −0 plugin/djangojump.vim
View
21 doc/djangojump.txt
@@ -34,7 +34,8 @@ tip:
5. reload cache
:DReloadCache
-
+
+
install details
===============
@@ -44,3 +45,21 @@ linux platform is ok, it\'s not tested under windows platform, maybe it can wor
2. open vim at django project root folder, then you can use these commands
note: this plugin need python2.6+ support
+
+
+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>
View
8 plugin/djangojump.vim
@@ -190,6 +190,8 @@ def url_to_view(url):
if regexp:
if url.find('/') == 0:
url = url[1:]
+ if not url.endswith('/'):
+ url += '/'
match = re.match(regexp, url)
if match:
module_abs_path = pattern.get('module')
@@ -351,3 +353,9 @@ com! DReloadCache python reload_to_cache()
com! Dfindcss python find_css()
com! Dfindjs python find_js()
com! DGotoscript python go_to_js_css()
+
+nmap <c-d><c-t> :DTpltoview<CR>
+nmap <c-d><c-v> :DViewtotpl<CR>
+nmap <c-d><c-u> :DUrltoview /
+nmap <c-d><c-s> :DGotoscript<CR>
+nmap <c-d><c-r> :DReloadCache<CR>

0 comments on commit 89a6a50

Please sign in to comment.
Something went wrong with that request. Please try again.