-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
132 lines (101 loc) · 3.8 KB
/
.bashrc
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
export BASH_SILENCE_DEPRECATION_WARNING=1
# sync history between all tmux sessions
# append unique commands to global history immediately
shopt -s histappend
# enable glob star expansion
shopt -s globstar
export HISTCONTROL=ignoreboth:erasedups
# Force prompt to write history after every command.
# http://superuser.com/questions/20900/bash-history-loss
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
#Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".
# http://stackoverflow.com/questions/9457233/unlimited-bash-history
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
# Change the file location because certain bash sessions truncate .bash_history file upon close.
# http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login
export HISTFILE=~/.bash_eternal_history
export PATH=/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
export PATH="$PATH:/opt/homebrew/opt/libpq/bin"
# Enable the subsequent settings only in interactive sessions
case $- in
*i*) ;;
*) return;;
esac
export VIMRC="$HOME/.vimrc"
export EDITOR='nvim'
export PATH="$PATH:$HOME/scripts"
export PATH="$PATH:$HOME/scripts/bun/bin"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export NVM_DIR="$HOME/.nvm"
source "${NVM_DIR}/nvm.sh"
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
export PS1="\$(whoami)@$(hostname -s):\w\$(parse_git_branch)$ "
#export PS1="$ "
# pnpm
export PNPM_HOME="$HOME/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
export FZF_CTRL_T_COMMAND='fd . --absolute-path --hidden --max-results=1000000 | sed "s|^$HOME|~|"'
__fzf_select__() {
local cmd opts
cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
-o -type f -print \
-o -type d -print \
-o -type l -print 2> /dev/null | command cut -b3-"}"
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse --scheme=path ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m"
eval "$cmd" |
FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" |
while read -r item; do
if [[ "$item" == ~* ]]
then
printf "~%q " "${item:1}" # if starts with ~, dont escape it at the start
else
printf '%q ' "$item" # escape special chars
fi
done
}
alias fly_push='gwip && npm version patch && git push && fly deploy'
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH
if [[ "$TERM" == "alacritty" ]]; then
alias tmux='TERM=alacritty-direct $(which tmux)'
alias ssh='TERM=xterm-256color ssh'
fi
alias doom='~/.config/emacs/bin/doom'
include () {
[[ -f "$1" ]] && source "$1"
}
include "$HOME/.bashrc.private"
. "$HOME/.cargo/env"
function lynx() {
lynxpath="$(which lynx)"
useragent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.79 Safari/537.1 Lynx"
if [ -e "$HOME/.config/lynx/lynx.cfg" ];then
export LYNX_CFG="$HOME/.config/lynx/lynx.cfg"
fi
if [ -e "$HOME/.config/lynx/lynx.lss" ];then
export LYNX_LSS="$HOME/.config/lynx/lynx.lss"
fi
if [ ! -x "$lynxpath" ]; then
echo "Doesn't look like lynx is installed."
exit 1
fi
"$lynxpath" --useragent="$useragent" "$@"
}
function duck() {
lynx "https://lite.duckduckgo.com/lite?q=$*"
}
function duck!() {
lynx "https://lite.duckduckgo.com/lite?q=$*+!"
}
. "$HOME/.local/bin/env"