-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvars
178 lines (153 loc) · 5.88 KB
/
vars
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# vim: set filetype=sh:
# Ref:
# eval $(ssh-agent -s)
# ssh-add ~/.ssh/id_rsa
# ----------------------------------------------------------------
#export MLR_REPL_PS1='mlr: '
#export MLR_REPL_PS1='μλρ: '
#export MLR_REPL_PS1='μιλλερ: '
export MLR_REPL_PS1='μεταμόρφωσις: '
export MLR_KEY_COLOR=darkorange
export MLR_VALUE_COLOR=darkgoldenrod
export LUMIN_MATCH_COLOR=red
# See also aliases file.
# The alias is for interactive use. The $PAGER is for, at least, git diff. I
# find that omitting the -r from $PAGER but leaving it in place for the alias
# makes the screen output look less janky. In particular, with $PAGER being
# "less -r", git diff on-screen information doesn't start showing the first
# diff-output line.
#export PAGER='less -j.5 -r'
export PAGER='less'
export EDITOR=vim
# ----------------------------------------------------------------
# Set my prompt, using bash-prompt escapes and xterm text-coloring escapes.
#
# Some bash-prompt escapes:
# \d: date
# \h: hostname
# \H: hostname.domainname
# \j: number of background jobs
# \t: time
# \u: username
# \v: Bash version
# \V: Extended bash version
# \w: pwd
# \W: basename of pwd
# Simpler predecessors:
# export PS1='`whoami`:`pwd`% '
# export PS1='\u@\h:\W% '
# Example:
# kerl@sprax[tmp] jobs=1 dirs=2$
# \_____________/ \___________/|
# green red green
# Load xterm-style color variables:
. ~/.colorrc
# black white
# red green blue
# cyan magenta yellow
if [ "`whoami`" = "root" ]; then
color1="$red"
color2="$yellow"
else
#color1="$green"
#color2="$yellow"
color1="$yellow"
color2="$yellow"
color3="$green"
#color1="$red"
#color2="$red"
fi
# Notes:
#
# * show_jobs_and_dirs is just a C program which prints the "jobs=1 dirs=2" parts
# when they are non-trivial. I wrote it in C to avoid stack traces when ^C-ing
# an empty prompt line.
#
# * The \[ \] around xterm escape sequences are important in shell prompts so that
# the shell can properly compute the length of the prompt string which in turn
# is essential to avoid screen-garbaging on history editing of long command lines.
#
# * $PS1ENV is for various work/project-specific things, typically set up in ~/.vars-site
# which is in a private repo.
if [ -z "$BASH_VERSION" ]; then # zsh
export PS1="${green}%n@%m[%c]${red}[j%js%?]${green}%#${textdefault} "
else
#export PS1="\[${bold}${color1}\]\u@\h""\[${color2}\]"'[s$?j$(echo -n $(jobs | wc -l))d$(echo -n $(dirs -p | wc -l))]'"\[${color1}\][\W]\$\[${textdefault}\] "
# See pathnick.c
#export PS1="\[${bold}${color1}\]\u@\h""\[${color2}\]"'[s$?j$(echo -n $(jobs | wc -l))d$(echo -n $(dirs -p | wc -l))]'"\[${color1}\]\[${color3}\]\`pathnick\`\[${color1}\][\W]\$\[${textdefault}\] "
#export PS1="\[${bold}${color1}\]\u@${HOSTNAME%.*.*}""\[${color2}\]"'[s$?j$(echo -n $(jobs | wc -l))d$(echo -n $(dirs -p | wc -l))]'"\[${color1}\]\[${color3}\]\`pathnick\`\[${color1}\][\W]\$\[${textdefault}\] "
# Other conditions may certainly apply. For me in 2022 my main goal is distinguishing visually
# from terminals on my Mac laptop from SSH sessions into a Linux EC2 instance.
if [ $(uname) = "Darwin" ]; then
ps1_color1=$'\033[1;38;5;178m'
ps1_color2=$'\033[1;38;5;136m'
ps1_color3=$'\033[1;38;5;178m'
ps1_color4=$'\033[1;38;5;136m'
else
ps1_color1=$'\033[1;38;5;208m'
ps1_color2=$'\033[1;38;5;94m'
ps1_color3=$'\033[1;38;5;208m'
ps1_color4=$'\033[1;38;5;94m'
fi
default=$'\033[0m'
hostname=${HOSTNAME%%.*}
if [ -f ~/.hostname-alias ]; then
hostname=$(cat ~/.hostname-alias)
fi
export PS1="\n\[${ps1_color1}\]\u\[${ps1_color2}\]@\[${ps1_color3}\]${hostname}\[${ps1_color4}\]"
PS1+="[\${PS1ENV}]"
PS1+='[$(git-show-current-branch-safe)]'
PS1+='[\W]'
#PS1+='[$?]'
PS1+="$ "
PS1+="\[${default}\]"
# For copy/paste into gists etc.:
# * more spare
# * blank line before prompt
export PSX="\n\[${ps1_color1}\]\u\h[\W]\[${default}\] "
alias psx='export PS1="$PSX"'
fi
# ----------------------------------------------------------------
# Augment path
if [ -z "$BEEN_HERE" ]; then
#export JAVA_HOME=/usr/local/jdk1.6.0_30
#export SCALA_HOME=/home/kerl/lang/scala/scala-2.10.1
#export SCALA_HOME=/home/kerl/lang/scala/scala-2.9.1.final
export RUBYLIB=$HOME/pub_http_internet/ruby:$HOME/pub_http_internet/ruby/ruffl
export PERLLIB=.:$HOME/scripts/perllib
# Path tail
export PATH=${PATH}:$HOME/bin/site
export PATH=${PATH}:$HOME/scripts/abbrevs
export PATH=${PATH}:$HOME/scripts/fundam/accel
export PATH=${PATH}:$HOME/scripts/fundam
export PATH=${PATH}:$HOME/scripts/arith
export PATH=${PATH}:$HOME/scripts/git
export PATH=${PATH}:$HOME/scripts/one-offs
export PATH=${PATH}:$HOME/bin/pgr
export PATH=${PATH}:/usr/local/go/bin
export PATH=${PATH}:$HOME/go/bin
export PATH=${PATH}:/usr/local/mysql/bin
export PATH=${PATH}:/usr/local/opt/node/bin
export PATH=${PATH}:/usr/local/Acrobat4/bin # Adobe Acrobat
export PATH=${PATH}:/usr/local/opt/jupyterlab/bin
# Path head
export PATH=/opt/homebrew/bin:${PATH}
export PATH=/usr/local/bin:${PATH}
export PATH=/usr/local/go/bin:${PATH}
export PATH=${HOME}/bin:${PATH}
export PATH=${HOME}/lbin:${PATH}
if [ -z "$MANPATH" ]; then
export MANPATH=$HOME/git/johnkerl/miller/man
fi
export MANPATH=${MANPATH}:/usr/share/man
export MANPATH=${MANPATH}:/usr/local/man
export MANPATH=${MANPATH}:/usr/local/share/man
#export MANPATH=${MANPATH}:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/share/man
export MANPATH=${MANPATH}://Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man
#export CLASSPATH=.:$HOME/aspectj/aspectj1.6/lib/aspectjrt.jar
#export CLASSPATH=${CLASSPATH}:/home/kerl/scala/scalatest-1.6.1/scalatest-1.6.1.jar
#export CLASSPATH=${CLASSPATH}:/usr/share/maven-repo/junit/junit/4.x/junit-4.x.jar
export LD_LIBRARY_PATH=/usr/local/lib
export DYLD_LIBRARY_PATH=/usr/local/lib
export BEEN_HERE=yes
fi