bash/.bashrc (view raw)
1# better history syncing
2shopt -s histappend
3export HISTCONTROL=ignoreboth:erasedups
4HISTSIZE=40000
5HISTFILESIZE=40000
6
7# cool options for cool kids
8shopt -s \
9 autocd \
10 globstar \
11 checkwinsize \
12 cdspell \
13 dirspell \
14 expand_aliases \
15 dotglob \
16 gnu_errfmt \
17 histreedit \
18 nocasematch
19
20bind 'set completion-ignore-case on'
21bind 'set show-all-if-ambiguous on'
22bind 'set colored-stats on'
23bind 'set completion-display-width 1'
24bind 'TAB:menu-complete'
25
26# fzy reverse search
27__fzy_history() {
28 ch="$(fc -l 1000 | fzy | cut -f2)"
29 : "${ch#"${ch%%[![:space:]]*}"}"
30 printf "$_"
31}
32
33bind -x '"\C-r": READLINE_LINE=$(__fzy_history); READLINE_POINT="${#READLINE_LINE}"'
34
35complete -cf doas
36
37# z
38[[ -f /usr/local/etc/profile.d/z.sh ]] &&
39. /usr/local/etc/profile.d/z.sh
40
41for i in ~/.bashrc.d/[0-9]*; do
42 . "$i"
43done
44
45export NVM_DIR="$HOME/.nvm"
46[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
47[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
48
49# The next line updates PATH for the Google Cloud SDK.
50if [ -f '/Users/icy/Downloads/google-cloud-sdk/path.bash.inc' ]; then . '/Users/icy/Downloads/google-cloud-sdk/path.bash.inc'; fi
51
52# The next line enables shell command completion for gcloud.
53if [ -f '/Users/icy/Downloads/google-cloud-sdk/completion.bash.inc' ]; then . '/Users/icy/Downloads/google-cloud-sdk/completion.bash.inc'; fi