File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,17 @@ function! s:ComposerInstallFunc(arg)
5555 endif
5656endfunction
5757
58- function ! s: ComposerKnowWhereCurrentFileIs ()
59- let l: currentWord = explode (' <cword>' )
60- exec " !grep ClassNameToFind ../onebip/vendor/composer -R | awk '{print $6}' | awk -F\' '{print $2}'"
58+ map <F6> :call ComposerKnowWhereCurrentFileIs()<CR>
59+ function ! ComposerKnowWhereCurrentFileIs ()
60+ let l: currentWord = expand (' <cword>' )
61+ let l: command = " grep " . l: currentWord . " vendor/composer -R | awk '{print $6}' | awk -F\\ ' '{print $2}'"
62+ let l: commandFileFound = l: command . ' | wc -l'
63+ let l: numberOfResults = system (l: commandFileFound )
64+ if l: numberOfResults == 1
65+ let l: fileName = system (l: command )
66+ let l: openFileCommand = ' tabe ' g: project_path . l: fileName
67+ exec l: openFileCommand
68+ else
69+ exec " normal \<c-p> " . expand (' <cword>' )
70+ endif
6171endfunction
You can’t perform that action at this time.
0 commit comments