Skip to content

Instantly share code, notes, and snippets.

@dmytro
Created November 30, 2011 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmytro/1407798 to your computer and use it in GitHub Desktop.
Save dmytro/1407798 to your computer and use it in GitHub Desktop.
Dot files - fragments
PS1="\u@\h:\W $ "
short_path () {
local max_len=20
path=$(pwd)
len=$(echo $path | wc -c)
if test $len -lt $max_len; then
echo $path
else
st=$(echo $path | cut -c-8)
echo "${st}.../$(basename $path)"
fi
}
case "$TERM" in
screen)
PROMPT_COMMAND='echo -ne "\033k$(id -un):$(short_path)\033\\"'
;;
esac
# windows, time, date -always on line:
hardstatus alwayslastline "Screen: %-Lw%{= bw}%50>%n%f* %t%{-}%+Lw%<%=%{kw}%H: %D/%M/%d %C"
# Turn off start message:
startup_message off
# Set messages timeout to one second:
msgwait 5
shell /bin/bash
# change the default escape from ctrl-a to '
# NOTE: Sometime problems with cut&paste #escape "''"
escape "``"
## change the default escape from ctrl-a to ctrl-\ #escape ^\\\ # # will be escape # escape ^[[
defscrollback 10000
# emulate .logout message
pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
# nethack style messages
nethack on
deflogin off
## Keybindings ##
bind ^\
### detach screen session from this terminal bindkey -k k6 detach
## to kill current screen window.
bindkey -k k7 kill
# Home
bindkey -k kh prev
# End
bindkey -k kH next
### to create a new screen
bindkey -k k1 screen
### to move to previous window
bindkey -k k2 prev
### to move to next window
bindkey -k k3 next
### to rename current screen window
bindkey -k k4 title
multiuser on
acladd root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment