Files
dotfiles/bashrc
2025-07-29 17:33:49 +02:00

74 lines
1.5 KiB
Bash

# Commands that should be applied only for interactive shells.
[[ $- == *i* ]] || return
HISTCONTROL=erasedups:ignorespace
HISTFILESIZE=100000
HISTSIZE=10000
HISTTIMEFORMAT="%F %T "
shopt -s histappend
shopt -s checkwinsize
shopt -s extglob
shopt -s globstar
shopt -s checkjobs
# Bash completion
[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && source "/opt/homebrew/etc/profile.d/bash_completion.sh"
bind "set completion-ignore-case on"
bind "set show-all-if-ambiguous on"
# *** *** Tools *** ***
# asdf
if command -v brew >/dev/null 2>&1 && [ -f "$(brew --prefix asdf)/libexec/asdf.sh" ]; then
source "$(brew --prefix asdf)/libexec/asdf.sh"
fi
# Mise
if command -v mise >/dev/null 2>&1; then
eval "$($HOME/.local/bin/mise activate bash)"
fi
# GitHub CLI completion
if command -v gh >/dev/null 2>&1; then
eval "$(gh completion -s bash)"
fi
# fzf
if command -v fzf >/dev/null 2>&1 && [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then
eval "$(fzf --bash)"
fi
# Direnv
if command -v direnv >/dev/null 2>&1; then
eval "$(direnv hook bash)"
fi
# Zoxide
if command -v zoxide >/dev/null 2>&1; then
eval "$(zoxide init bash)"
fi
# Atuin
if command -v atuin >/dev/null 2>&1; then
eval "$(atuin init bash)"
fi
# Starship
if command -v starship >/dev/null 2>&1 && [[ $TERM != "dumb" ]]; then
eval "$(starship init bash)"
PS1="$(/opt/homebrew/bin/starship prompt)"
fi
# *** *** Aliases *** ***
alias reload="source $HOME/.bashrc"
source "$HOME/.aliases"
# *** *** Functions *** ***
for file in ~/.functions/*.sh; do
source "$file"
done