diff --git a/README.md b/README.md index b8b1b56..216665f 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ This command exec the installation flow of composer's install. This process requ :ComposerInstall [--no-dev ..] ``` This command exec `composer install`. Now you can attach after this command a custom callback to exec your personal flow. + +```vim +:ComposerInit [--no-dev ..] +``` +This command exec `composer init`. + ```vim function! MyCallbackFunction() exec ':silent ! ctags -a %' @@ -28,6 +34,11 @@ In this example after every `composer install` I exec a ctags generation ``` This command exec `composer update`. +```vim +:ComposerRequireFunc +``` +This command exec `composer require `. + ```vim :ComposerJSON ``` diff --git a/plugin/vim-composer.vim b/plugin/vim-composer.vim index f3608fc..a5565f2 100644 --- a/plugin/vim-composer.vim +++ b/plugin/vim-composer.vim @@ -24,7 +24,10 @@ endif command! -narg=* ComposerRun call s:ComposerRunFunc() command! -narg=* ComposerInstall call s:ComposerInstallFunc() +command! -narg=* ComposerInit call s:ComposerInit() command! -narg=* ComposerUpdate call s:ComposerUpdateFunc() +command! -narg=* ComposerRequire call s:ComposerRequireFunc() + command! ComposerGet call s:ComposerGetFunc() command! ComposerJSON call s:OpenComposerJSON() @@ -56,10 +59,18 @@ function! s:ComposerInstallFunc(arg) endif endfunction +function! s:ComposerInit() + exe s:ComposerRunFunc("init") +endfunction + function! s:ComposerUpdateFunc(arg) exe s:ComposerRunFunc("update") endfunction +function! s:ComposerRequireFunc() + exe s:ComposerRunFunc("require") +endfunction + function! g:ComposerKnowWhereCurrentFileIs() let g:currentWord = expand('') let l:command = "grep " . g:currentWord . " ./vendor/composer -R | awk '{print $6}' | awk -F\\' '{print $2}'"