vcsh icon indicating copy to clipboard operation
vcsh copied to clipboard

How to use mr/vcsh to manage external requirements?

Open nfarrar opened this issue 10 years ago • 4 comments

I'm curious what the recommended method for using mr/vcsh to manage external requirements is.

Specifically in my case, neobundle (https://github.com/Shougo/neobundle.vim). My .vimrc relies on this repository.

nfarrar avatar Mar 12 '14 22:03 nfarrar

Did you find a solution in the meantime? I dimly remember talking about something like that on IRC.

There's two default ways: git submodule and git subtree; the latter seems to work with vcsh, but I have not tried it myself.

RichiH avatar May 07 '14 08:05 RichiH

Hi,

For that matter, I'm using a mr way to handle that in my config repositories (I borrowed that from @aspiers).

A part of my $HOME/.mrconfig (which loads and update all the vcsh repositories) is also looking for files in a $HOME/.config/mr/groups.d for additionnal files. Each config repositories can put at least a files in this. Then, it's just a matter of mr u in $HOME to update or clone all my configurations and external code/tools.

# Finally load the groups
    for d in ~/.config/mr/groups.d; do
        if test -d "$d"; then
            include_files "$d"/*
        else
            echo "$d missing" >&2
        fi
    done

The complete file is here : https://github.com/vdemeester/vcsh-home/blob/master/.mrconfig.

But it will only work if using vcsh with mr.

vdemeester avatar May 09 '14 07:05 vdemeester

I ended up doing this:

[$HOME/.config/vcsh/repo.d/neobundle.git]
checkout =
    mkdir -p ~/.vim/bundle;
    VCSH_BASE=~/.vim/bundle/neobundle.vim vcsh clone https://github.com/Shougo/neobundle.vim     neobundle

... but your solution is much better, I'm going to try to switch over to that this weekend. :)

nfarrar avatar May 09 '14 15:05 nfarrar

This is an extremely old issue, but I'll drop in my solution as well. Since I want to keep my vim configuration in one place, I use a vim function to check out neobundle if needed. That way I don't need to check out all the vim modules on all the hosts I use. I can use vanilla vim in other places:

function! NeoBundleInstaller()
  echom "Starting NeoBundle Installation"
  let neobundlegit = 'https://github.com/Shougo/neobundle.vim'
  let destination = expand('~/.vim/bundle/neobundle.vim')
  call mkdir(destination, "p")
  call system('git clone ' . neobundlegit . ' ' . destination)
  echom "all done, restart vim"
endfunction

https://gist.github.com/ressu/1d85fadcbd463bb5ea12

ressu avatar Jul 17 '15 06:07 ressu