Skip to content

Instantly share code, notes, and snippets.

@gigawhitlocks
Created November 13, 2013 18:28
Show Gist options
  • Save gigawhitlocks/7453896 to your computer and use it in GitHub Desktop.
Save gigawhitlocks/7453896 to your computer and use it in GitHub Desktop.
Opens first argument in a local emacs session that's already running, from the shell on a remote machine.
function evil() {
if [ $SSH_CLIENT ];
then if [[ $1 == /* ]];
then ssh ian@$(echo $SSH_CLIENT | awk '{print $1}') -C emacsclient /ubuntu@isw-dev:$1;
else ssh ian@$(echo $SSH_CLIENT | awk '{print $1}') -C emacsclient /ubuntu@isw-dev:$(pwd)/$1;
fi
else vim;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment