Permalink
Browse files

* Remapped shortcuts to Alt key.

* New: alt+a - application main dir
* New: alt+t - project main dir
  • Loading branch information...
1 parent a873d66 commit 760224801385abf17af32242b1e346db10dbb58e @zergu committed Aug 20, 2011
Showing with 57 additions and 41 deletions.
  1. +25 −21 README.md
  2. +32 −20 project-jumper.vim
View
@@ -14,40 +14,44 @@ Latest version of Vim Project Jumper can be found at https://github.com/zergu/Vi
Installation
------------
-Unpack all *.vim files and this README into ~/.vim/plugin/project-jumper/ directory. Restart Vim if necessary.
+Unpack all *.vim files and this README into `~/.vim/plugin/project-jumper/` directory. Restart Vim if necessary.
Usage
-----
-Default shortucts work from Vim edit mode. To invoke a jump keep @ctrl@ presses and then type @j@ and other key depending whare you're trying to jump.
+Default shortucts work from Vim edit mode. To invoke a jump keep `alt` presses and then type `j` and other key depending whare you're trying to jump to.
-Shortcuts are working only when current directory (you can check it with :pwd command) is from inside a project. Avoid using shortucts elsewhere cause it can do some heavy and unsuccessful file searching.
+Shortcuts are working only when current directory (you can check it with `:pwd` command) is from inside a project. Avoid using shortucts elsewhere cause it can do some heavy and unsuccessful file searching.
Default shortcuts
-----------------
Project project related:
-* <C-j><C-m> Model: Explore lib/model dir.
-* <C-j><C-s> Schema: Edit config/*schema.yml (menu for multiple options).
-* <C-j><C-y> CSS: Explore web/css dir.
-* <C-j><C-j> JS: Explore web/js dir.
-* <C-j><C-t> Test: Explore test dir.
-* <C-j><C-h> Helper: Explore lib/helper dir.
-* <C-j><C-f> Form: Explore lib/form dir.
-* <C-j><C-i> Filter: Explore lib/filter dir.
-* <C-j><C-l> Lib: Explore lib dir.
-* <C-j><C-q> SQL: Explore data/sql dir.
-* <C-j><C-x> Fixtures: Explore data/fixtures dir.
+
+* `<M-j><M-t>` Root: Explore project main dir.
+* `<M-j><M-m>` Model: Explore lib/model dir.
+* `<M-j><M-s>` Schema: Edit config/schema.yml (menu for multiple options).
+* `<M-j><M-k>` CSS: Explore web/css dir.
+* `<M-j><M-j>` JS: Explore web/js dir.
+* `<M-j><M-e>` Test: Explore test dir.
+* `<M-j><M-h>` Helper: Explore lib/helper dir.
+* `<M-j><M-f>` Form: Explore lib/form dir.
+* `<M-j><M-i>` Filter: Explore lib/filter dir.
+* `<M-j><M-l>` Lib: Explore lib dir.
+* `<M-j><M-q>` SQL: Explore data/sql dir.
+* `<M-j><M-x>` Fixtures: Explore data/fixtures dir.
Application related (if your project has more that one application avaiable options are shown):
-* <C-j><C-u> Layout: Edit $appname/templates/*layout*.php file (supports multiple options).
-* <C-j><C-o> Modules: Explore $appname/modules dir.
-* <C-j><C-r> Routing: Edit $appname/config/routing.yml file.
-* <C-j><C-g> AppConfig: Edit $appname/config/app.yml file.
-* <C-j><C-a> Action: Edit actions.class.php when editing or exploring module templates.
-* <C-j><C-v> View: While cursor is placed on function header tries to edit associaded view. If none could be found, explores views directory.
+
+* `<M-j><M-c>` Controller: Edit actions.class.php when editing or exploring module templates.
+* `<M-j><M-v>` View: While cursor is placed on function header tries to edit associaded view. If none could be found, explores views directory.
+* `<M-j><M-u>` Layout: Edit $appname/templates/*layout*.php file (supports multiple options).
+* `<M-j><M-o>` Modules: Explore $appname/modules dir.
+* `<M-j><M-r>` Routing: Edit $appname/config/routing.yml file.
+* `<M-j><M-g>` AppConfig: Edit $appname/config/app.yml file.
+* `<M-j><M-a>` Application: Explore application maind dir.
Remapping shortucts
-------------------
-Just copy mappings from the beginning of project-jumper.vim file to your .vimrc and modify it.
+Just copy mappings from the beginning of `project-jumper.vim` file to your `.vimrc` and modify it.
View
@@ -4,24 +4,32 @@ if exists("g:loaded_Jumper")
endif
let g:loaded_Jumper = 1 " Version numbrer
-" Key bindings
-map <C-j><C-m> :call JumperJump("model")<CR>
-map <C-j><C-s> :call JumperJump("schema")<CR>
-map <C-j><C-y> :call JumperJump("css")<CR>
-map <C-j><C-j> :call JumperJump("js")<CR>
-map <C-j><C-t> :call JumperJump("test")<CR>
-map <C-j><C-h> :call JumperJump("helper")<CR>
-map <C-j><C-f> :call JumperJump("form")<CR>
-map <C-j><C-i> :call JumperJump("filter")<CR>
-map <C-j><C-l> :call JumperJump("lib")<CR>
-map <C-j><C-q> :call JumperJump("sql")<CR>
-map <C-j><C-x> :call JumperJump("fixtures")<CR>
-map <C-j><C-u> :call JumperJump("layout")<CR>
-map <C-j><C-o> :call JumperJump("modules")<CR>
-map <C-j><C-r> :call JumperJump("routing")<CR>
-map <C-j><C-g> :call JumperJump("appconfig")<CR>
-map <C-j><C-a> :call JumperJump("action")<CR>
-map <C-j><C-v> :call JumperJump("view")<CR>
+" Key bindings: MVC
+map <M-j><M-m> :call JumperJump("model")<CR>
+map <M-j><M-v> :call JumperJump("view")<CR>
+map <M-j><M-c> :call JumperJump("contoller")<CR>
+
+" Key bindings: project
+map <M-j><M-t> :call JumperJump("root")<CR>
+map <M-j><M-s> :call JumperJump("schema")<CR>
+map <M-j><M-e> :call JumperJump("test")<CR>
+map <M-j><M-h> :call JumperJump("helper")<CR>
+map <M-j><M-f> :call JumperJump("form")<CR>
+map <M-j><M-i> :call JumperJump("filter")<CR>
+map <M-j><M-l> :call JumperJump("lib")<CR>
+map <M-j><M-q> :call JumperJump("sql")<CR>
+map <M-j><M-x> :call JumperJump("fixtures")<CR>
+
+" Key bindings: applications
+map <M-j><M-a> :call JumperJump("application")<CR>
+map <M-j><M-u> :call JumperJump("layout")<CR>
+map <M-j><M-o> :call JumperJump("modules")<CR>
+map <M-j><M-r> :call JumperJump("routing")<CR>
+map <M-j><M-g> :call JumperJump("appconfig")<CR>
+
+" Key bindings: frontend assets
+map <M-j><M-j> :call JumperJump("js")<CR>
+map <M-j><M-k> :call JumperJump("css")<CR>
" JUMP!
function! JumperJump(target)
@@ -89,12 +97,16 @@ function! JumperJump(target)
elseif a:target == "routing"
let l:results = split(system("find ".l:maindir."apps -type d -mindepth 1 -maxdepth 1 | grep -v .svn"))
execute "edit ".l:results[s:MultipleChoice(l:results)]."/config/routing.yml"
+ " App main dir - explore
+ elseif a:target == "application"
+ let l:results = split(system("find ".l:maindir."apps -type d -mindepth 1 -maxdepth 1 | grep -v .svn"))
+ execute "Explore ".l:results[s:MultipleChoice(l:results)]
" App config - edit
elseif a:target == "appconfig"
let l:results = split(system("find ".l:maindir."apps -type d -mindepth 1 -maxdepth 1 | grep -v .svn"))
execute "edit ".l:results[s:MultipleChoice(l:results)]."/config/app.yml"
- " Jump to actions from views (magical)
- elseif a:target == "action"
+ " Jump to controller from views (magical)
+ elseif a:target == "controller"
let l:currdir = expand("%:p:h")
if matchend(l:currdir, "templates") != -1 " Check if we're in templates dir
silent execute "edit ".l:currdir."/../actions/actions.class.php"

0 comments on commit 7602248

Please sign in to comment.