diff --git a/.bashrc b/.bashrc index 1fbe852..ae6b71e 100644 --- a/.bashrc +++ b/.bashrc @@ -2,21 +2,16 @@ # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +# history settings HISTSIZE=5000 HISTFILESIZE=10000 + shopt -s histappend -#export PROMPT_COMMAND="history -a" + PROMPT_COMMAND="history -a; $PROMPT_COMMAND" export HISTCONTROL=erasedups -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize @@ -25,63 +20,42 @@ shopt -s checkwinsize # match all files and zero or more directories and subdirectories. shopt -s globstar -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - # set a fancy prompt (non-color, unless we know we "want" color) export TERM=xterm-color -# 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 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 definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -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 - # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH:$HOME/.local/bin" fi +# source fzf script for interactive use if [ -f ~/git/dotfiles/.bash_fzf ] ; then . ~/git/dotfiles/.bash_fzf fi +# source headscale autocompletion script if [ -f ~/.autoheadscale ] ; then . ~/.autoheadscale fi +# set prompt colors and style if [ -f ~/.PS1 ] ; then source ~/.PS1 else PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ ' fi +# get function to see available colors for PS1 if [ -f ~/git/dotfiles/.colors ] ; then . ~/git/dotfiles/.colors fi +# fetch uninstalled package names when attempting command (arch only) +if [ -f /usr/share/doc/pkgfile/command-not-found.bash ] ; then + source /usr/share/doc/pkgfile/command-not-found.bash +fi