Last active
September 28, 2018 02:41
-
-
Save blacknon/a47083f3bbbd0374998bdf7e3b3396cc to your computer and use it in GitHub Desktop.
ssh接続先でローカルのbashrcとvimrcを利用するためのシェル芸
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
※4行目のdotfilesのとこは自分のファイル群のとこなので、適宜置き換え。なお、sourceでの読み込みは対応できないので、読んでるファイルがあったら全部指定する必要がある