Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ This command exec the installation flow of composer's install. This process requ
```
This command exec `composer install`

```vim
:ComposerJSON
```
This command open `composer.json`

## Install
```vim
Bundle 'vim-php/vim-composer'
Expand Down
9 changes: 9 additions & 0 deletions plugin/vim-composer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ endif
command! -narg=* ComposerRun call s:ComposerRunFunc(<q-args>)
command! -narg=* ComposerInstall call s:ComposerRunFunc("install ".<q-args>)
command! ComposerGet call s:ComposerGetFunc()
command! ComposerJSON call s:OpenComposerJSON()

function! s:ComposerRunFunc(arg)
let s:arg = a:arg
Expand All @@ -33,3 +34,11 @@ endfunction
function! s:ComposerGetFunc()
exe "! curl -Ss https://getcomposer.org/installer | php"
endfunction

function! s:OpenComposerJSON()
if filereadable("./composer.json")
exe "vsplit ./composer.json"
else
echo "Composer json doesn't exist"
endif
endfunction