Skip to content

Instantly share code, notes, and snippets.

@macrat
Last active June 12, 2022 05:29
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 macrat/d386fc2ffa09ed1db7b5594112b521b4 to your computer and use it in GitHub Desktop.
Save macrat/d386fc2ffa09ed1db7b5594112b521b4 to your computer and use it in GitHub Desktop.
Vimの:termの中でうっかりVimを開くのを防いでくれるbashrc
function flattenvim() {
if [ "${VIM_SERVERNAME}" != "" ]; then
\vim --servername ${VIM_SERVERNAME} --remote $*
else
\vim --servername "$(head -c 12 /dev/random | base64)" $*
fi
}
alias vi=flattenvim
alias vim=flattenvim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment