chiark / gitweb /
dot/gpg.conf.m4, dot/gpg-agent.conf, Makefile: Adopt GnuPG configuration.
[profile] / dot / rcrc
... / ...
CommitLineData
1### -*-rc-*-
2### rc profile
3
4###--------------------------------------------------------------------------
5### Prompt machinery.
6
7host = `{hostname}
8
9if (~ $TERM linux* screen* xterm* vt100* eterm*) {
10 bold = `{tput bold} unbold = `{tput sgr0}
11}; if not {
12 bold = '' unbold = ''
13}
14
15if (~ `{id -u} 0) {
16 left = `{echo « | iconv -f utf8 -t //translit}
17 right = `{echo » | iconv -f utf8 -t //translit}
18}; if not {
19 u = `{id -un}
20 if (~ $u mdw mwooding) {
21 u = '' left = '[' right = ']'
22 }; if not {
23 u = $u^@ left = '{' right = '}'
24 }
25 if (~ $__mdw_tty `{tty}) {
26 left = '<' right = '>'
27 }; if not {
28 __mdw_tty = `{tty}
29 }
30}
31
32if (~ $#SSH_CLIENT 0 && ! ~ $__mdw_sechost $host) {
33 sec_l = '(' sec_r = ')'
34}; if not {
35 sec_l = '' sec_r = ''
36}
37
38fn prompt {
39 cwd = `{pwd}
40 if (~ $cwd $home $home/*) {
41 cwd = `{echo $cwd | sed 's:^' ^ $home ^':~:'}
42 }
43 prompt = ($bold$left$sec_l$u$host$sec_r^' '^$cwd$right$unbold '')
44}
45prompt
46
47###--------------------------------------------------------------------------
48### Convenient aliases.
49
50fn rootly { ~ $#* 0 && * = $SHELL; $__MDW_ROOTLY $* }
51fn r { rootly $* }
52fn re { rootly $EDITOR $* }
53fn pstree { builtin pstree -hl }
54fn e { $EDITOR $* }
55fn @ { ssh $* }
56
57fn ls {
58 if (test -t 1) {
59 builtin ls $LS_OPTIONS '--color=auto' $*
60 }; if not {
61 builtin ls $*
62 }
63}
64
65fn greplike {
66 grep = $1; shift
67 if (test -t 1) {
68 builtin $grep '--color=always' $* | mdw-pager
69 }; if not {
70 builtin grep $*
71 }
72}
73fn grep { greplike grep $* }
74fn egrep { greplike egrep $* }
75fn fgrep { greplike fgrep $* }
76fn zgrep { greplike zgrep $* }
77
78if (~ $INSIDE_EMACS 22.*,comint) PAGER = cat
79
80###----- That's all, folks --------------------------------------------------