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
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ This command exec the installation flow of composer's install. This process requ
:ComposerInstall [--no-dev ..]
```
This command exec `composer install`. Now you can attach after this command a custom callback to exec your personal flow.

```vim
:ComposerInit [--no-dev ..]
```
This command exec `composer init`.

```vim
function! MyCallbackFunction()
exec ':silent ! ctags -a %'
Expand All @@ -28,6 +34,11 @@ In this example after every `composer install` I exec a ctags generation
```
This command exec `composer update`.

```vim
:ComposerRequireFunc
```
This command exec `composer require <vendor/repository> <version>`.

```vim
:ComposerJSON
```
Expand Down
11 changes: 11 additions & 0 deletions plugin/vim-composer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ endif

command! -narg=* ComposerRun call s:ComposerRunFunc(<q-args>)
command! -narg=* ComposerInstall call s:ComposerInstallFunc(<q-args>)
command! -narg=* ComposerInit call s:ComposerInit(<q-args>)
command! -narg=* ComposerUpdate call s:ComposerUpdateFunc(<q-args>)
command! -narg=* ComposerRequire call s:ComposerRequireFunc(<q-args>)

command! ComposerGet call s:ComposerGetFunc()
command! ComposerJSON call s:OpenComposerJSON()

Expand Down Expand Up @@ -56,10 +59,18 @@ function! s:ComposerInstallFunc(arg)
endif
endfunction

function! s:ComposerInit()
exe s:ComposerRunFunc("init")
endfunction

function! s:ComposerUpdateFunc(arg)
exe s:ComposerRunFunc("update")
endfunction

function! s:ComposerRequireFunc()
exe s:ComposerRunFunc("require")
endfunction

function! g:ComposerKnowWhereCurrentFileIs()
let g:currentWord = expand('<cword>')
let l:command = "grep " . g:currentWord . " ./vendor/composer -R | awk '{print $6}' | awk -F\\' '{print $2}'"
Expand Down