Skip to content

Instantly share code, notes, and snippets.

@antoineMoPa
Created March 6, 2021 21:26
Show Gist options
  • Save antoineMoPa/0f088480195f80ab043c857b0591d1fe to your computer and use it in GitHub Desktop.
Save antoineMoPa/0f088480195f80ab043c857b0591d1fe to your computer and use it in GitHub Desktop.
.bashrc part to create the "e" alias that opens a file in your current emacs (if none, starts emacs)
emacsclient_and_start_emacs_if_needed () {
if [ -z `pgrep emacs` ]
then
nohup emacs &
sleep 1
fi
emacsclient -n $1
}
alias e="emacsclient_and_start_emacs_if_needed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment