Skip to content

Commit 350b37f

Browse files
committed
Added a command to init new composer project
1 parent 0af4481 commit 350b37f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ This command exec the installation flow of composer's install. This process requ
1515
:ComposerInstall [--no-dev ..]
1616
```
1717
This command exec `composer install`. Now you can attach after this command a custom callback to exec your personal flow.
18+
19+
```vim
20+
:ComposerInit [--no-dev ..]
21+
```
22+
This command exec `composer init`.
23+
1824
```vim
1925
function! MyCallbackFunction()
2026
exec ':silent ! ctags -a %'

plugin/vim-composer.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ endif
2424

2525
command! -narg=* ComposerRun call s:ComposerRunFunc(<q-args>)
2626
command! -narg=* ComposerInstall call s:ComposerInstallFunc(<q-args>)
27+
command! -narg=* ComposerInit call s:ComposerInit(<q-args>)
2728
command! -narg=* ComposerUpdate call s:ComposerUpdateFunc(<q-args>)
2829
command! -narg=* ComposerRequire call s:ComposerRequireFunc(<q-args>)
2930

@@ -58,6 +59,13 @@ function! s:ComposerInstallFunc(arg)
5859
endif
5960
endfunction
6061

62+
function! s:ComposerInit(arg)
63+
exe s:ComposerRunFunc("init")
64+
if len(g:composer_install_callback) > 0
65+
exe "call ".g:composer_install_callback."()"
66+
endif
67+
endfunction
68+
6169
function! s:ComposerUpdateFunc(arg)
6270
exe s:ComposerRunFunc("update")
6371
endfunction

0 commit comments

Comments
 (0)