diff --git a/.bashrc b/.bashrc index 14f8322..43b035a 100755 --- a/.bashrc +++ b/.bashrc @@ -44,6 +44,7 @@ export BROWSER=w3m # ... and vim is the Best export EDITOR=vim +export PAGER=less # very min bash aliases alias ls='ls -F --color' alias l='ls -l' @@ -55,6 +56,7 @@ alias wa='ssh warhol' # test -f ~/.bash_aliases && source ~/.bash_aliases test -f ~/.bash_prompt && source ~/.bash_prompt +eval "$(dircolors ~/.dircolors)" # shellcheck disable=SC2046 test -f ~/.dircolors && eval $(dircolors ~/.dircolors) test -d ~/dotfiles/bash_completion && { @@ -65,6 +67,12 @@ test -d ~/dotfiles/bash_completion && { done; } + +export MANPAGER="less -R --use-color -Dsc -Dk+r -Dd+g -Du+c -DPgb -DEbR" +export MANROFFOPT="-P -c" + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe.sh ] && eval "$(lesspipe.sh)" # startship # https://starship.rs/ type -t starship >/dev/null && { @@ -154,10 +162,25 @@ function _prepend_path() { _append_path -r "$1" "$2"; } ### rust test -d "$HOME/.cargo/bin" && PATH=$(_prepend_path "$PATH" "$HOME/.cargo/bin") - ### golang - default is $HOME/go/bin export GOPATH="$HOME/go" test -d "$HOME"/go/bin && PATH=$(_prepend_path "$PATH" "$HOME/go/bin") +type -t buffalo > /dev/null 2>&1 && eval "$(buffalo completion bash)" + +function bt { + echo "bash bt $*" + local opt= + test "$#" -ne 0 && opt="-m ""$*" + # shellcheck disable=SC2086 + buffalo test $opt | _gotestcolored | less -RF +} +function btv { + echo "bash btv $*" + local opt= + test "$#" -ne 0 && opt="-m ""$*" + # shellcheck disable=SC2086 + buffalo test -v $opt | _gotestcolored | less -RF +} # host specific bash test -r "$HOME/.bashrc-${HOSTNAME}" && source "$HOME/.bashrc-${HOSTNAME}" @@ -518,7 +541,9 @@ then PATH="/home/patrick/perl5/bin${PATH:+:${PATH}}"; export PATH; PERL5LIB="/home/patrick/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; PERL_LOCAL_LIB_ROOT="/home/patrick/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; - PERL_MB_OPT="--install_base /home/patrick/perl5"; export PERL_MB_OPT; + PERL_MB_OPT='--install_base /home/patrick/perl5' + # shellcheck disable=2090 + export PERL_MB_OPT; fi # pyenv