Skip to content

Commit 9d7c736

Browse files
author
Gianluca Arbezzano
committed
Close #2 init composer.json open command
1 parent 67b3e9f commit 9d7c736

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ To run command for example `:ComposerRun validate` run command validate for your
1111
```
1212
This command exec the installation flow of composer's install. This process require `curl`
1313

14+
```vim
15+
:ComposerJSON
16+
```
17+
This command open `composer.json`
1418

1519
## Install
1620
```vim

plugin/vim-composer.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ endif
2323

2424
command! -narg=* ComposerRun call s:ComposerRunFunc(<q-args>)
2525
command! ComposerGet call s:ComposerGetFunc()
26+
command! ComposerJSON call s:OpenComposerJSON()
2627

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

0 commit comments

Comments
 (0)