Skip to content

Instantly share code, notes, and snippets.

@sknutsonsf
Last active November 26, 2022 05:08
Show Gist options
  • Save sknutsonsf/97580459d86bae851418 to your computer and use it in GitHub Desktop.
Save sknutsonsf/97580459d86bae851418 to your computer and use it in GitHub Desktop.
Screenrc for emacs lovers
# Settings for Screen to allow better use of emacs
#
# Most important: rebind ctrl-A
## Control-^ (usually Control-Shift-6) is traditional and the only key not used by emacs
escape ^^^^
#
## do not trash BackSpace, usually DEL
bindkey -k kb
bindkey -d -k kb
#
## do not trash Delete, usually ESC [ 3 ~
bindkey -k kD
bindkey -d -k kD
#
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# Enables use of shift-PgUp and shift-PgDn
termcapinfo xterm|xterms|xs|rxvt ti@:te@
# Erase background with current bg color
defbce "on"
# Enable 256 color term
term xterm-256color
# Cache 30000 lines for scroll back
defscrollback 30000
# uncomment if you want status in lastline - I did not find it useful
#hardstatus alwayslastline
# Very nice tabbed colored hardstatus line
#hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc
} %C%A%{-}'
# Hide hardstatus: ctrl-a f
#bind f eval "hardstatus ignore"
# Show hardstatus: ctrl-a F
#bind F eval "hardstatus alwayslastline"
@sknutsonsf
Copy link
Author

I've been using emacs as my "command line UI" for many years. These settings allow effective use of emacs within screen for working on a remote server like AWS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment