Skip to content

Instantly share code, notes, and snippets.

@blacknon
Last active September 28, 2018 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blacknon/a47083f3bbbd0374998bdf7e3b3396cc to your computer and use it in GitHub Desktop.
Save blacknon/a47083f3bbbd0374998bdf7e3b3396cc to your computer and use it in GitHub Desktop.
ssh接続先でローカルのbashrcとvimrcを利用するためのシェル芸
ssh -t user@host '
bash --rcfile <(
echo -e ' $(cat <(echo "function lvim() { vim -u <(echo "$(cat ~/.vimrc|base64)"|base64 -d) \$@ ; }") \
~/dotfiles/{.bashrc,sh_function,sh_alias,bash_prompt} \
<(echo -e alias vim=lvim) | \
base64
) ' \
|base64 -d)'
@blacknon
Copy link
Author

※4行目のdotfilesのとこは自分のファイル群のとこなので、適宜置き換え。なお、sourceでの読み込みは対応できないので、読んでるファイルがあったら全部指定する必要がある

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment