Last active
December 31, 2019 03:31
-
-
Save howardabrams/9239141 to your computer and use it in GitHub Desktop.
Bulk of my server-side profile that when I first log into the system, it starts up Emacs as a daemon and a `tmux` session. From then on, I just attach to that `tmux,` and use `emacsclient` to edit files... especially with a `split-window`.
This file contains 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
alias e='emacsclient -q -a emacs' | |
EDITOR=emacsclient | |
function e { | |
tmux new-window -a -n "emacs" "$EDITOR $@" | |
} | |
function ee { | |
tmux split-window "$EDITOR $@" | |
} | |
# If we have a tmux session running, attach to it, otherwise, start | |
# one up....oh, and let's start emacs as a daemon too. | |
if type tmux >/dev/null 2>&1 | |
then | |
if ps -u $USER -o fname | grep tmux >/dev/null | |
then | |
if [ -z "$TMUX" ] | |
then | |
unalias e | |
tmux attach | |
fi | |
else | |
emacs --daemon | |
exec tmux | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment