Skip to content

Instantly share code, notes, and snippets.

@funrep
Created September 17, 2012 18:07
Show Gist options
  • Save funrep/3738824 to your computer and use it in GitHub Desktop.
Save funrep/3738824 to your computer and use it in GitHub Desktop.
safdsdfsdf
klr's mksh configuration
: ${EDITOR:=/bin/ed} ${TERM:=vt100} ${HOSTNAME:=$(ulimit -c 0;hostname -s 2>&-)}
[[ $HOSTNAME = @(localhost|*([ ])) ]] && HOSTNAME=$(ulimit -c 0;hostname 2>&-)
: ${HOSTNAME:=nil}; if (( USER_ID )); then PS1='$'; else PS1='#'; fi
function precmd {
local e=$?
(( e )) && print -n "$e|"
}
PS1=$'$'\001\e[2;34m\001''$(local d=${PWD:-?} p=~; [[ $p = ?(*/) ]] || \
d=${d/#$p/~}; local m=${%d} n p=...; (( m > 0 )) || m=${#d}
(( m > (n = (COLUMNS/3 < 7 ? 7 : COLUMNS/3)) )) && d=${d:(-n)} || \
p=; print -nr -- "$p$d")'$'\001\033[0;32m\001 '"$PS1 "$'\001\e[0m\001'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment