3 ms·
I very recently set out to start bringing my vimrc with me when logging into remote hosts and came up with this. Host * !github.com RemoteCommand echo -e
by uberduper 7y ago
I very recently set out to start bringing my vimrc with me when logging into remote hosts and came up with this.
Host * !github.com
RemoteCommand echo -e "syntax enable\nset ts=2\nset sw=2\n" > ~/.tmp_vimrc && bash -c 'set -a; vi() { vim -u ~/.tmp_vimrc "$@"; }; set +a;bash -l'
RequestTTY yes
It gets ugly when you get a lot of options in there.
It's possible to just curl or scp something in place via RemoteCommand above, or `source: https://foo.io/vimrc` https://foo.io/vimrc` but my security paranoia lead me to this instead.
- jacobparker 7y agoCurl it, check the sha256 of the download vs a hardcoded one and then source it if they match? The URL you curl could be a GitHub blob URL (theoretically immutable) but if you check the hash you’re not trusting GH for anything other than availability.