From: Mark Wooding Date: Sat, 23 Oct 2010 12:20:11 +0000 (+0100) Subject: dot/rcrc: Configuration for the Plan 9 shell. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/1d89ce867576117e37e22166261cf2aef93b80a6?ds=sidebyside dot/rcrc: Configuration for the Plan 9 shell. This needs a login to make it actually work, which is a little annoying. I've added aliases appropriately. --- diff --git a/dot/rcrc b/dot/rcrc new file mode 100644 index 0000000..2723b2c --- /dev/null +++ b/dot/rcrc @@ -0,0 +1,41 @@ +### rc profile + +###-------------------------------------------------------------------------- +### Prompt machinery. + +host = `hostname + +if (~ $TERM linux* screen* xterm* vt100* eterm*) { + bold = `{tput bold} unbold = `{tput sgr0} +} else { + bold = '' unbold = '' +} + +if (~ `{id -u} 0) { + left = `{iconv -f utf8 -t //translit <<< «} + right = `{iconv -f utf8 -t //translit <<< »} +} else { + u = `{id -un} + if (~ $u mdw mwooding) { + u = '' left = '[' right = ']' + } else { + u = $u^@ left = '{' right = '}' + } + if (~ $__mdw_tty `tty) { + left = '<' right = '>' + } else { + __mdw_tty = `tty + } +} + +if (~ $#SSH_CLIENT 0 && ! ~ $__mdw_sechost $host) { + sec_l = '(' sec_r = ')' +} + +fn prompt { + cwd = `pwd + if (~ $cwd $home $home/*) { + cwd = `{sed 's:^' ^ $home ^':~:' <<< $cwd} + } + prompt = ($bold$left$sec_l$u$host$sec_r^' '^$cwd$right$unbold '') +} diff --git a/setup b/setup index 499841e..5242bd8 100755 --- a/setup +++ b/setup @@ -135,6 +135,7 @@ dotfiles=" cgrc tigrc gdbinit guile + rcrc toprc aspell.conf lisp-init.lisp:.cmucl-init.lisp