Forked from yenliangl/create_dedicated_emacs_server_for_each_screen.csh
Created
February 12, 2017 05:24
-
-
Save zaxebo1/ac3f55caa450deb31eeae8c9ed5d18bd to your computer and use it in GitHub Desktop.
Get Emacs workspace for each GNU screen
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
setenv DEFAULT_WORKSPACE "default" | |
if ( $?WORKSPACE == 0 ) then | |
setenv WORKSPACE $DEFAULT_WORKSPACE | |
endif | |
# Define alias 'et' to connect to the proper Emacs server identified by EMACS_SEVER_NAME | |
setenv EDITOR "emacsclient -s $WORKSPACE -t -a ''" | |
alias et "$EDITOR" | |
# Create alias 'kill-emacs' to kill proper Emacs server. | |
alias kill-emacs "$EDITOR --eval '(kill-emacs)'" | |
alias start-emacs-server "emacs --daemon=$WORKSPACE" | |
# $WINDOW is set by GNU screen to indicate current window number. | |
if ( $?WINDOW ) then | |
# Create aliase to start dvtm session for each window in a workspace | |
alias dvtm "dtach -A /tmp/dvtm-session-${WORKSPACE}-${WINDOW} dvtm" | |
else | |
# Create convenient aliases for creating workspaces only | |
# when not inside GNU screen to avoid accidentally starting GNU screen inside GNU screen. | |
foreach p ( study bozaalarm bug $DEFAULT_WORKSPACE ) | |
alias ws-$p "setenv WORKSPACE $p; screen -mS $p -DR" | |
end | |
foreach s ( 1 2 3 4 5 6 7 8 9 ) | |
alias dvtm$s "dtach -A /tmp/dvtm-session-${WORKSPACE}-$s dvtm" | |
end | |
alias dvtm "dtach -A /tmp/dvtm-session dvtm" | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment