1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/rc
# Plan 9 rc shell configuration
# Sourced via $rcrc environment variable
home=$HOME
user=$USER
# Plan 9 tools
if(test -d /usr/local/plan9){
PLAN9=/usr/local/plan9
path=($PLAN9/bin $path)
}
# PATH as list
path=($home/.local/bin /usr/local/bin /usr/bin /bin $path)
# Editor
EDITOR=acme
PAGER=nobs
# Font
font=/lib/font/bit/gomono/Go-Mono.14.font
# Prompt
prompt=('% ' ' ')
# Special characters
nl='
'
tab=' '
# cd with directory tracking
prevdir=$home
fn cd {
if(~ $1 '-')
builtin cd $prevdir
if not {
if(! ~ $prevdir $*) prevdir=`{pwd}
builtin cd $*
}
# update acme window label if in acme
if(test -f /dev/label)
echo -n `{pwd}/- > /dev/label >[2]/dev/null
}
# Source config modules
. $home/.config/.plan9/aliases.rc
. $home/.config/.plan9/functions.rc
# Machine-specific overrides
if(test -f $home/.config/.plan9/local.rc)
. $home/.config/.plan9/local.rc
# Plan 9 service startup (plan9port)
if(~ $#PLAN9 1){
mkdir -p $NAMESPACE
if(! test -e $NAMESPACE/font) fontsrv &
if(! test -e $NAMESPACE/plumb) plumber &
}
# Interactive setup
if(flag i){
fn sigexit { }
}