Created
January 5, 2012 08:10
-
-
Save yenliangl/1564216 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