Skip to content

Commit eac582e

Browse files
author
Gianluca Arbezzano
committed
Close #2 init composer.json open command
1 parent 6eeb33f commit eac582e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ This command exec the installation flow of composer's install. This process requ
1616
```
1717
This command exec `composer install`
1818

19+
```vim
20+
:ComposerJSON
21+
```
22+
This command open `composer.json`
23+
1924
## Install
2025
```vim
2126
Bundle 'vim-php/vim-composer'

plugin/vim-composer.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ endif
2424
command! -narg=* ComposerRun call s:ComposerRunFunc(<q-args>)
2525
command! -narg=* ComposerInstall call s:ComposerRunFunc("install ".<q-args>)
2626
command! ComposerGet call s:ComposerGetFunc()
27+
command! ComposerJSON call s:OpenComposerJSON()
2728

2829
function! s:ComposerRunFunc(arg)
2930
let s:arg = a:arg
@@ -33,3 +34,11 @@ endfunction
3334
function! s:ComposerGetFunc()
3435
exe "! curl -Ss https://getcomposer.org/installer | php"
3536
endfunction
37+
38+
function! s:OpenComposerJSON()
39+
if filereadable("./composer.json")
40+
exe "vsplit ./composer.json"
41+
else
42+
echo "Composer json doesn't exist"
43+
endif
44+
endfunction

0 commit comments

Comments
 (0)