dotfiles/.local/share/bash/bashrc.sh

33 lines
1.1 KiB
Bash
Raw Normal View History

2019-05-28 17:44:30 +02:00
# Define where cd looks for targets
2022-01-19 11:31:07 +01:00
[ -d "$HOME/Documents/Code" ] && CDPATH='.:~/Documents/Code'
2019-05-28 17:44:30 +02:00
2019-06-19 20:43:45 +02:00
# Set the primary prompt string
# shellcheck disable=SC2154
2020-10-12 15:22:20 +02:00
PS1='┌──[\[\e[m\]\[\033[38;5;12m\]\t\[\e[m\]\[\e[m\]]──$(test 0 -eq $? || printf "[\033[m\033[38;5;196m$_\033[0m]──")[\[\e[m\]\[\033[38;5;166m\]\u\[\e[m\]\[\e[m\]:\[\e[m\]\[\033[38;5;168m\]\w\[\e[m\]\[\e[m\]\[\033[38;5;150m\]$(b=$(git branch --show-current 2>/dev/null) && (git diff-index --quiet --ignore-submodules HEAD 2>/dev/null && printf " ($b)" || printf " {$b}"))\[\e[m\]]\n└─${DISPLAY+➤} \$ \[\e[m\]'
2019-05-28 17:44:30 +02:00
# Don't record some commands
2022-03-16 09:52:53 +01:00
HISTIGNORE='[ ]*:ls:ll:exit:logout:history:clear:bg:fg'
2019-05-28 17:44:30 +02:00
# Remove old duplicate commands
HISTCONTROL='erasedups'
2019-06-19 20:43:45 +02:00
# Move the history file away from $HOME
2019-09-25 20:07:56 +02:00
HISTFILE="$XDG_CACHE_HOME/.bash_history"
2019-05-28 17:44:30 +02:00
# Print time of command in history
HISTTIMEFORMAT='{%Y-%m-%d %T} '
# Automatically trim long paths in the prompt
2019-06-19 20:43:45 +02:00
PROMPT_DIRTRIM=2
2019-05-28 17:44:30 +02:00
# Don't complete files with the following extensions
FIGNORE='~:.o:.swp:.pyc'
2019-11-11 18:44:44 +01:00
# Show hints in ./configure --option=
# shellcheck disable=SC2034
COMP_CONFIGURE_HINTS=1
2019-05-28 17:44:30 +02:00
: # ensure 0 exit code
2019-11-24 15:50:07 +01:00
# vim:wrap:lbr:bri:briopt=shift\:4: