Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Found applications are now sorted so their numbers are predictable.

* Also some refactoring.
  • Loading branch information...
commit b0cbd44be5d848e1430e30323be921f06f6f36b3 1 parent 54da9eb
@zergu authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 project-jumper.vim
View
15 project-jumper.vim
@@ -95,24 +95,24 @@ function! JumperJump(target)
execute "edit ".l:results[s:MultipleChoice(l:results)]
" Modules - explore
elseif a:target == "modules"
- let l:results = split(system("find ".l:maindir."apps -type d -mindepth 1 -maxdepth 1 | grep -v .svn"))
+ let l:results = s:AppFinder(l:maindir)
execute "Explore ".l:results[s:MultipleChoice(l:results)]."/modules"
" Layout - explore
elseif a:target == "layout"
- let l:results = split(system("find ".l:maindir."apps -type d -mindepth 1 -maxdepth 1 | grep -v .svn"))
+ let l:results = s:AppFinder(l:maindir)
let l:results = split(system("find ".l:results[s:MultipleChoice(l:results)]."/templates -name \"*layout*.php\" | grep -v .svn"))
execute "edit ".l:results[s:MultipleChoice(l:results)]
" Routing - edit
elseif a:target == "routing"
- let l:results = split(system("find ".l:maindir."apps -type d -mindepth 1 -maxdepth 1 | grep -v .svn"))
+ let l:results = s:AppFinder(l:maindir)
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"))
+ let l:results = s:AppFinder(l:maindir)
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"))
+ let l:results = s:AppFinder(l:maindir)
execute "edit ".l:results[s:MultipleChoice(l:results)]."/config/app.yml"
" Parent class - edit
elseif a:target == "parent"
@@ -155,6 +155,11 @@ function! JumperJump(target)
endtry
endfunction
+" Helper for finding application names
+function s:AppFinder(maindir)
+ return split(system("find ".a:maindir."apps -type d -mindepth 1 -maxdepth 1 | egrep -v '.svn|.git' | sort"))
+endfunction
+
" Helper for multiple targets
function s:MultipleChoice(results)
let num = len(a:results)
Please sign in to comment.
Something went wrong with that request. Please try again.