-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc
127 lines (111 loc) · 3.03 KB
/
rc
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
[ -d /usr/local/plan9 ] && export PLAN9=${PLAN9:-/usr/local/plan9}
if ! [[ :$PATH: =~ :.p9p: ]]; then
PATH=$PATH:$HOME/.p9p/bin
fi
if ! [[ :$PATH: =~ :$PLAN9: ]]; then
PATH=$PATH:$PLAN9/bin
fi
if ! [[ :$PATH: =~ :$HOME/go/bin: ]]; then
PATH=$PATH:$HOME/go/bin
fi
if ! [[ :$PATH: =~ :$HOME/.cargo/bin: ]]; then
PATH=$PATH:$HOME/.cargo/bin
fi
# Let gs find the plan9port document fonts.
GS_FONTPATH=$PLAN9/postscript/font
BROWSER=firefox
# Prompt (is almost a no-op in bash)
H=$(hostname | sed 's/\..*//')
# Equivalent variables for rc(1).
home=$HOME
user=$USER
EDITOR=/usr/local/plan9/bin/E
GIT_EDITOR=$EDITOR
#font=/lib/font/bit/lucsans/euro.8.font
#fixedfont=/lib/font/bit/lucm/unicode.9.font
if [ "$(uname -s)" = "Linux" ]; then
font='/mnt/font/LucidaGrande-RegularW/10a/font,/mnt/font/LucidaGrande-RegularW/20a/font'
fixedfont='/mnt/font/LucidaGrandeMono/11a/font,/mnt/font/LucidaGrandeMono/22a/font'
else
font=/mnt/font/LucidaGrande/15a/font,/mnt/font/LucidaGrande/30a/font
fixedfont=/mnt/font/BerkeleyMono-Regular/15a/font,/mnt/font/BerkeleyMono-Regular/30a/font
fi
NAMESPACE=/tmp/ns.$H
# On Apple silicon certain binaries fail to execute in 9term, sam or acme
# due to bad CPU, arch(1) when run in plan9port binaries, returns i386
# instead of arm (plan9port INSTALL program is setting arch as arm64).
#
# So we need to pass `arch -arm64` to acme, sam, 9term to to solve the issue.
case "$(uname -a)" in
*ARM64*)
ARCH="arm64";;
*)
ARCH=$(arch);;
esac
export home prompt user font fixedfont GS_FONTPATH BROWSER H EDITOR GIT_EDITOR NAMESPACE PATH ARCH
# if $NAMESPACE doesn't exist, we need to create it.
[ -d "$NAMESPACE" ] || mkdir "$NAMESPACE"
if [ "$TERM" = dumb ]; then
_cd(){
\cd "$@" &&
case "TERM!$-" in
linux!*)
;;
*!*i*)
awd
esac
}
alias cd=_cd
alias cls=cw
alias ipython="ipython --simple-prompt --colors=NoColor"
set +o emacs
set +o vi
set -a # autoexport
unset PROMPT_COMMAND
# Plumb files instead of starting new editor.
unset FCEDIT VISUAL
# Make sure mpage prints in letter mode.
MPAGE="-t -bLetter"
# Get rid of backspace characters in Unix man output.
PAGER=nobs
IPY_TEST_SIMPLE_PROMPT=1
NO_COLOR=1
PIPENV_QUIET=1
PIPENV_DONT_LOAD_ENV=1
PIPENV_HIDE_EMOJIS=1
PIPENV_NOSPIN=1
export MPAGE PAGER IPY_TEST_SIMPLE_PROMPT NO_COLOR PIPENV_QUIET PIPENV_DONT_LOAD_ENV PIPENV_HIDE_EMOJIS PIPENV_NOSPIN
if [[ "$SHELL" =~ "zsh" ]]; then
unset zle
unset zle_bracketed_paste
unsetopt PROMPT_SP
unsetopt prompt_cr
unsetopt prompt_subst
if whence -w precmd > /dev/null; then
unfunction precmd
fi
if whence -w preexec > /dev/null; then
unfunction preexec
fi
unset IFS PS1 prompt
IFS=''
PS1="%% "
elif [ "$(basename $SHELL)" = "rc" ]; then
prompt="% "
else
IFS=''
prompt='% '
fi
if [ -x $HOMEBREW_PREFIX/bin/brew ]; then
_br(){
cmd="$1";shift
$HOMEBREW_PREFIX/bin/brew "$cmd" "$@"|nobs
}
alias brew=_br
fi
fi
# aliases
alias lf="$PLAN9/bin/lc -F"
# start your engines.
[ -x "$HOME"/.p9p/bin/p9plumb ] && "$HOME"/.p9p/bin/p9plumb start