all repos — dotfiles @ 0737906569f5447d45b1b117c97a06baa485ce7c

my *nix dotfiles

bash/.bashrc (view raw)

 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
# better history syncing
shopt -s histappend
export HISTCONTROL=ignoreboth:erasedups
HISTSIZE=40000
HISTFILESIZE=40000

# cool options for cool kids
shopt -s \
    autocd \
    globstar \
    checkwinsize \
    cdspell \
    dirspell \
    expand_aliases \
    dotglob \
    gnu_errfmt \
    histreedit \
    nocasematch 

bind 'set completion-ignore-case on'
bind 'set show-all-if-ambiguous on'
bind 'set colored-stats on'
bind 'set completion-display-width 1'
bind 'TAB:menu-complete'

# Ctrl+W kills word
stty werase undef
bind '"\C-w": backward-kill-word'

# fzy reverse search
__fzy_history() {
    ch="$(fc -l 1 | awk -F'\t' '{print $2}' | sort -u | fzy)"
    : "${ch#"${ch%%[![:space:]]*}"}"
    printf "$_"
}

bind -x '"\C-r": READLINE_LINE=$(__fzy_history); READLINE_POINT="${#READLINE_LINE}"'

complete -cf doas

# z (darwin)
[[ -f /usr/local/etc/profile.d/z.sh ]] &&
. /usr/local/etc/profile.d/z.sh

# z (bsd)
[[ -f ~/bin/z.sh ]] &&
. ~/bin/z.sh

for i in ~/.bashrc.d/[0-9]*; do
    . "$i"
done

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/icy/Downloads/google-cloud-sdk/path.bash.inc' ]; then . '/Users/icy/Downloads/google-cloud-sdk/path.bash.inc'; fi

# The next line enables shell command completion for gcloud.
if [ -f '/Users/icy/Downloads/google-cloud-sdk/completion.bash.inc' ]; then . '/Users/icy/Downloads/google-cloud-sdk/completion.bash.inc'; fi