3

I have a few servers that I have personal accounts on, I have created an SVN repository to contain my home directory so that I can manage my dotfiles across these servers, which I'm finding works very well and makes it easy for me to track the changes I make (which previously would get lost/overwritten very easily).

The new problem I face is that at work I'm now forced to share one of two accounts (deploy/root) with a bunch of coworkers, and as a result I can't set too much in the way of global options.

Is there anything I can do to have the other end see my .vimrc in that session while I'm logged in (or some kludge and $VIMRC setting that makes vim load my local one?) vim is the main thing but it'd be nice to extend the principle to others as well.

richo
  • 998

2 Answers2

2

This is an old question but I thought I'd add my suggestions in case any one else has similar issues and they aren't in a position to come up with a better solution:

For Vim, a simplistic solution would be to run:

vim -u /my/personal/repos/dotfiles/.vimrc

But that will use the account's .vim / vimfiles directory structure. If the server is some form of *nix and you want to run a POSIX compliant shell with personalised environment variables, start a sub-shell with a different value for HOME, e.g. the following command will start a Bash login shell:

HOME=/my/personal/repos/dotfiles/ bash -l

The above will source /my/personal/repos/dotfiles/.profile or .bash_profile and any other processes spawned by the sub-shell will inherit its environment variables (including HOME).

0

I think that https://github.com/fsquillace/kyrat does what you need.

I wrote it long time ago before sshrc was born and it has more benefits compared to sshrc:

  • It does not require dependencies on xxd for both hosts (which can be unavailable on remote host)
  • Kyrat uses a more efficient encoding algorithm
  • It is just ~20 lines of code (really easy to understand!)
  • No need of root access or any installations to the remote host

For instance:

$> echo "alias q=exit" > ~/.config/kyrat/bashrc
$> kyrat myuser@myserver.com
myserver.com $> q
exit