Files
server-dotfiles/bashrc
2025-03-11 04:42:14 +00:00

23 lines
851 B
Bash

# Function to parse git branch
function parse_git_branch {
git branch 2>/dev/null | grep '^*' | colrm 1 2
}
# Function to parse git status
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "✗"
}
# Custom prompt with proper Unicode escapes and hexadecimal notation
# PS1=$'\[\e[38;5;10m\]\u\[\e[m\] \[\e[38;5;14m\]\w\[\e[m\] \[\e[38;5;9m\]\uE0B0\[\e[m\] \[\e[38;5;11m\]$(parse_git_branch)$(parse_git_dirty)\[\e[m\] \[\e[38;5;15m\]\uF013\[\e[m\] '
PS1=$'\[\e[38;5;2m\]\u\[\e[m\]@\[\e[38;5;8m\]\h\[\e[m\] \[\e[38;5;14m\]\w\[\e[m\] \[\e[38;5;9m\]\uE0B0\[\e[m\] \[\e[38;5;11m\]$(parse_git_branch)$(parse_git_dirty)\[\e[m\] \[\e[38;5;15m\]\uF013\[\e[m\] '
set -o vi
export RUBY_YJIT_ENABLE=1
HISTSIZE=50000
HISTFILESIZE=100000
shopt -s histappend
eval "$(direnv hook bash)"