-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc.darwin
99 lines (86 loc) · 3.4 KB
/
.bashrc.darwin
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
source ~/.bashrc.common
export HISTSIZE=1000000
# like you have to ask, ugh
export SHELL=/bin/bash
# annoying
export BASH_SILENCE_DEPRECATION_WARNING=1
# setup specific hooks for hadoops and spark
#source ~/.hadoops
# at some point brew decided to update packages without asking for your
# permission most packages are not written to be safely updated, often pulling
# in breaking changes, or failing to safely migrate datastores, etc. as such,
# you should force homebrew to not update anything without your permission.
export HOMEBREW_NO_AUTO_UPDATE=1
# you run the risk of your packages getting old but it's better than trying to
# install one new package and having your entire development environment be
# broken for a couple days because the homebrew community can't be bothered to
# consider how to write safe migrations
# weening myself off vim
alias vim=nvim
alias vi=nvim
export EDITOR=nvim
alias iso="date -u +%FT%TZ"
#export PATH=$HOME/javatrash/apache-hive-1.1.0-bin/bin:$PATH
PS1='$? - ❯❯❯ '
if [ -d /opt/homebrew/bin ]; then
# m1 mac puts it here
BREW_STUFF=/opt/homebrew/bin
else
# otherwise do it here
BREW_STUFF=/usr/local/bin
fi
export PATH=$BREW_STUFF:$PATH
# hardcode ruby for now
export RUBY_GEMS_BIN=$HOME/.gem/ruby/2.6.0/bin
export PATH=$RUBY_GEMS_BIN:$PATH
# hardcode random python thing
export PATH=$HOME/Library/Python/3.8/bin:$PATH
# rbenv started printing out its usage stuff on every opening of bash so turning this off for now
# echo before rbenv
# echo `which rbenv`
# # 'brew install rbenv' because the installed ruby does not work with jekyll anymore
# if $(which rbenv); then
# eval "$(rbenv init - bash)"
# fi
# echo after rbenv
# add .local for pipx
export PATH=$HOME/.local/bin:$PATH
# rabbit installs to /usr/local/sbin/ for some reason where nothing else does
export PATH=/usr/local/sbin:$PATH
# fennel, or other luarocks tools
export PATH=$PATH:$HOME/.luarocks/bin
# for deno
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
unset PROMPT_COMMAND
export plzdo="awk '{print}'"
_show_last_two_directories() {
# this is pretty much just for the prompt command. i thought i could do it
# via string interpolation but boy was i wrong!
# here was the attempt.
# PROMPT_COMMAND='echo -en "\033]0; $(echo -n ${PWD/#$HOME/~} | awk \'BEGIN { FS="/"; OFS="/" } {print $(NF-1), $NF}\') \a"'
# here is one way to use this function instead, so that it actually works without string escaping breaking it
# PROMPT_COMMAND='echo -en "\033]0; $(echo -n ${PWD/#$HOME/~} | _show_last_two_directories ) \a"'
awk 'BEGIN { FS="/"; OFS="/" } {print $(NF-1), $NF}'
}
# do things to get titlebar set
case $TERM in
xterm*)
#PROMPT_COMMAND='echo -ne "${USER}@${HOSTNAME}:${PWD/#$HOME/~}"'
#PROMPT_COMMAND='echo -en "\033]0; ${PWD/#$HOME/~} \a"'
PROMPT_COMMAND='echo -en "\033]0; $(echo -n ${PWD/#$HOME/~} | _show_last_two_directories ) \a"'
;;
esac
if [ -f $HOME/.bashrc.darwin.work ]; then
#export PATH=$(pyenv root)/shims:$PATH
source $HOME/.bashrc.darwin.work
fi
# TODO: not sure if necessary if you've brew installed openjdk.
# it bugs me with an error when opening a terminal so silence for now
# if [ -f /usr/libexec/java_home ]; then
# export JAVA_HOME=$(/usr/libexec/java_home)
# fi
eval "$(brew shellenv)"
. "$HOME/.cargo/env"
# for openjdk java? not sure what added
export PATH="$(brew --prefix)/opt/openjdk/bin:$PATH"