diff --git a/README.md b/README.md index eecc98c..1628225 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,11 @@ This command exec the installation flow of composer's install. This process requ ``` This command exec `composer install` +```vim +:ComposerJSON +``` +This command open `composer.json` + ## Install ```vim Bundle 'vim-php/vim-composer' diff --git a/plugin/vim-composer.vim b/plugin/vim-composer.vim index b41a151..4985648 100644 --- a/plugin/vim-composer.vim +++ b/plugin/vim-composer.vim @@ -24,6 +24,7 @@ endif command! -narg=* ComposerRun call s:ComposerRunFunc() command! -narg=* ComposerInstall call s:ComposerRunFunc("install ".) command! ComposerGet call s:ComposerGetFunc() +command! ComposerJSON call s:OpenComposerJSON() function! s:ComposerRunFunc(arg) let s:arg = a:arg @@ -33,3 +34,11 @@ endfunction function! s:ComposerGetFunc() exe "! curl -Ss https://getcomposer.org/installer | php" endfunction + +function! s:OpenComposerJSON() + if filereadable("./composer.json") + exe "vsplit ./composer.json" + else + echo "Composer json doesn't exist" + endif +endfunction