File tree 2 files changed +22
-2
lines changed
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
14
14
``` vim
15
15
:ComposerInstall [--no-dev ..]
16
16
```
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
18
25
19
26
``` vim
20
27
:ComposerJSON
21
28
```
22
29
This command open ` composer.json `
23
30
31
+
24
32
## Install
25
33
``` vim
26
34
Bundle 'vim-php/vim-composer'
Original file line number Diff line number Diff line change @@ -21,8 +21,9 @@ if !exists("g:composer_cmd")
21
21
endif
22
22
endif
23
23
24
+
24
25
command ! -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> )
26
27
command ! ComposerGet call s: ComposerGetFunc ()
27
28
command ! ComposerJSON call s: OpenComposerJSON ()
28
29
@@ -42,3 +43,14 @@ function! s:OpenComposerJSON()
42
43
echo " Composer json doesn't exist"
43
44
endif
44
45
endfunction
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