-
Notifications
You must be signed in to change notification settings - Fork 1
/
bash.rc
103 lines (76 loc) · 2.72 KB
/
bash.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
#!/bin/sh
export EDITOR="nvim"
export VISUAL="nvim"
export GPG_TTY=$(tty)
export FCEDIT=$EDITOR
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export BASH_SILENCE_DEPRECATION_WARNING=1
export PATH=$PATH:/usr/local/go/bin:$HOME/.scripts:/opt/homebrew/bin:$HOME/.local/bin:$HOME/.local/google-cloud-sdk/bin
HISTCONTROL=ignorespace
set -o vi
set -o noclobber
# Linux only
# change caps to escape
# setxkbmap -option caps:escape
ulimit -n 65535
. "$HOME/.asdf/asdf.sh"
# if nvim is installed, set it as MANPAGER
if command -v nvim 1>/dev/null 2>&1; then
export MANPAGER='nvim +Man!'
export MANWIDTH=999
fi
gcb(){
echo `git rev-parse --abbrev-ref HEAD 2>/dev/null`
}
git_branch() {
git branch 2>/dev/null 1>&2 && echo "- ( `gcb``git diff --quiet || echo ' *'` )"
}
[[ -f $HOME/.aliases ]] && source $HOME/.aliases
[[ -f $HOME/.fzf_scripts ]] && source $HOME/.fzf_scripts
[[ -f $HOME/.work.rc ]] && source $HOME/.work.rc
if [ -n "$RANGER_LEVEL" ]; then export PS1="[ranger]$PS1"; fi
# NVM -- Node Version Manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
set_prompt() {
# Custom PS1
# export PS1="╭─[ \u :: \h ] @ [ \e[33m\W\e[0m ]\$(git_branch)\n╰─➤➤ "
local reset="\e[0m";
local black="\e[1;30m";
local blue="\e[1;34m";
local cyan="\e[1;36m";
local green="\e[0;32m";
local orange="\e[1;33m";
local purple="\e[1;35m";
local red="\e[1;31m";
local violet="\e[1;35m";
local white="\e[1;37m";
local yellow="\e[1;33m";
#export PS1="\w ${green}\$(git_branch)${reset} \n ⬤ ${yellow}⬤ ${blue}⬤ ${reset} "
export PS1="\w \e[0;32m\$(git_branch)\e[0m \n ⬤ "
}
set_prompt
# FZF settings
FZF_DEFAULT_OPTS="--extended -i --height=50% --layout=default"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
# hook up direnv
if command -v direnv 1>/dev/null 2>&1; then
eval "$(direnv hook bash)"
fi
# enable bash completion
if [ "$(uname)" == "Darwin" ]; then
export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d"
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
else
[[ -f /usr/share/bash-completion/bash_completion ]] && . /usr/share/bash-completion/bash_completion
fi
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/oli/google-cloud-sdk/path.bash.inc' ]; then . '/Users/oli/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/oli/google-cloud-sdk/completion.bash.inc' ]; then . '/Users/oli/google-cloud-sdk/completion.bash.inc'; fi
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
export PATH="/opt/homebrew/bin:$PATH"
eval "$(/opt/homebrew/bin/brew shellenv)"
# Rust toolings
. "$HOME/.cargo/env"