52 lines
1.5 KiB
Bash
52 lines
1.5 KiB
Bash
# ~/.bashrc: executed by bash(1) for non-login shells.
|
|
|
|
# If not running interactively, don't do anything
|
|
case $- in
|
|
*i*) ;;
|
|
*) return;;
|
|
esac
|
|
|
|
# don't put duplicate lines or lines starting with space in the history.
|
|
HISTCONTROL=ignoreboth
|
|
HISTSIZE=10000
|
|
HISTFILESIZE=20000
|
|
HISTTIMEFORMAT="%F %T "
|
|
|
|
# append to the history file, don't overwrite it
|
|
shopt -s histappend
|
|
|
|
# check the window size after each command and, if necessary,
|
|
# update the values of LINES and COLUMNS.
|
|
shopt -s checkwinsize
|
|
|
|
# Prints " (branch)" when inside a git repo, nothing otherwise.
|
|
__git_branch() {
|
|
local branch
|
|
branch=$(git symbolic-ref --short HEAD 2>/dev/null) || branch=$(git rev-parse --short HEAD 2>/dev/null) || return
|
|
printf ' (%s)' "$branch"
|
|
}
|
|
|
|
# Tokyo Night palette, matching files/tmux.conf: purple user@host, blue cwd,
|
|
# green git branch, gray prompt symbol.
|
|
PS1='\[\033[38;2;187;154;247;1m\]\u@\h\[\033[0m\] \[\033[38;2;122;162;247m\]\w\[\033[0m\]\[\033[38;2;158;206;106m\]$(__git_branch)\[\033[0m\]\n\[\033[38;2;86;95;137m\]\$\[\033[0m\] '
|
|
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
eval "$(dircolors -b)"
|
|
alias ls='ls --color=auto'
|
|
fi
|
|
|
|
if [ -f /opt/dotfiles/bash_aliases ]; then
|
|
. /opt/dotfiles/bash_aliases
|
|
fi
|
|
|
|
if ! shopt -oq posix; then
|
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
. /usr/share/bash-completion/bash_completion
|
|
elif [ -f /etc/bash_completion ]; then
|
|
. /etc/bash_completion
|
|
fi
|
|
fi
|
|
|
|
# Claude Code CLI installer env
|
|
[ -f /root/.local/bin/env ] && . /root/.local/bin/env
|