File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,21 @@ This command exec the installation flow of composer's install. This process requ
1414``` vim
1515:ComposerInstall [--no-dev ..]
1616```
17- This command exec ` composer install `
17+ This command exec ` composer install ` . Now you can attach after this command a custom callback to exec your personal flow.
18+ ``` vim
19+ function! MyCallbackFunction()
20+ exec ':silent ! ctags -a %'
21+ endfunction
22+ let g:composer_install_callback = "MyCallbackFunction"
23+ ```
24+ In this example after every ` composer install ` I exec a ctags generation
1825
1926``` vim
2027:ComposerJSON
2128```
2229This command open ` composer.json `
2330
31+
2432## Install
2533``` vim
2634Bundle 'vim-php/vim-composer'
Original file line number Diff line number Diff line change @@ -21,8 +21,9 @@ if !exists("g:composer_cmd")
2121 endif
2222endif
2323
24+
2425command ! -narg =* ComposerRun call s: ComposerRunFunc (<q-args> )
25- command ! -narg =* ComposerInstall call s: ComposerRunFunc ( " install " . <q-args> )
26+ command ! -narg =* ComposerInstall call s: ComposerInstallFunc ( <q-args> )
2627command ! ComposerGet call s: ComposerGetFunc ()
2728command ! ComposerJSON call s: OpenComposerJSON ()
2829
@@ -42,3 +43,14 @@ function! s:OpenComposerJSON()
4243 echo " Composer json doesn't exist"
4344 endif
4445endfunction
46+
47+ if ! exists (" g:composer_install_callback" )
48+ let g: composer_install_callback = " "
49+ endif
50+
51+ function ! s: ComposerInstallFunc (arg)
52+ exe s: ComposerRunFunc (" install" )
53+ if len (g: composer_install_callback ) > 0
54+ exe " call " .g: composer_install_callback ." ()"
55+ endif
56+ endfunction
You can’t perform that action at this time.
0 commit comments