config/bash/.bashrc

52 lines
1.6 KiB
Bash

# ~/.bashrc: executed by bash(1) for non-login shells.
# We source it in ~/.profile so that it is used for _all_ shells.
# Don't do anything if the shell isn't interactive
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicates or lines starting with a space in the history.
HISTCONTROL=ignoreboth
# store a long history
export HISTSIZE=1000000
export HISTFILESIZE=10000000
# append to the history file rather than overwriting it
shopt -s histappend
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# all my terminals support color so let's colorize this alllllll
PS1="\[\e[33m\][\t] \`if [[ \$? = '0' ]]; then echo \"\[\e[0;32m\]\"; else echo \"\[\e[0;31m\]\"; fi\`\u@\h\[\e[0m\]> "
# modify the title bar, too
PS1="\[\e]0;\u@\h: \w\a\]$PS1"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
alias kssh='kitty +kitten ssh'
# enable programmable completion features
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
# Add rustup and the standard rust tooling to the path
. "$HOME/.cargo/env"