.bashrc chopped into separate file.

This commit is contained in:
2021-06-16 04:12:17 -07:00
parent 3cb73cb62c
commit 4609a035af
6 changed files with 186 additions and 113 deletions

View File

@@ -58,13 +58,6 @@ HISTFILESIZE=5000
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
set -o vi
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Set command prompt
[ -x ~/devel/scripts/config/.profile.prompt ] && source ~/devel/scripts/config/.profile.prompt
# [ -x ${MYDIR}/.profile.dircolor ] && source ${MYDIR}/.profile.dircolor
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# User specific environment and startup programs
@@ -84,107 +77,6 @@ fi
export EDITOR=vim
export LESS=-R
#
# 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
#
# GIT
#
[ -f $MYSCRIPTS/bash/git-completion.bash ] && . $MYSCRIPTSE/bash/git-completion.bash
#
# colored GCC warnings and errors
#
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Aliases
#
if [ $kernel == "Darwin" ]; then
alias ls='ls -a'
alias ll='ls -la'
alias pd='pushd >/dev/null'
alias bd='popd'
else
alias ls='ls -a --color=auto'
alias ll='ls -la --color=auto'
alias pd='pushd >/dev/null'
alias bd='popd'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
function cgrep() {
if [[ $# -eq 0 ]]
then
echo "Usage: codegrep <pattern> "
else
grep -nR --colour \
--include=\*.cpp \
--include=\*.c \
--include=\*.hpp \
--include=\*.h \
--include=\*.inc \
--include=\*.php \
--include=\*.py \
--include=\*.sh \
--exclude-dir=.git \
--exclude-dir=.svn \
--exclude-dir=llcalc* \
--exclude-dir=00* \
"$1" .
fi
}
function create_tags() {
#Bloomberg
if [ -e /opt/swt/bin/ctags ]; then
CTAGS=/opt/swt/bin/ctags
else
CTAGS=ctags
fi
CTAGS_OPT='--recurse=yes '
CTAGS_OPT+='--verbose '
CTAGS_OPT+='--totals=yes '
CTAGS_OPT+='--tag-relative=yes '
CTAGS_DIR_CFG='.ctags_dir'
CTAGS_ROOT="$PWD"
if [ ! -f $PWD/$CTAGS_DIR_CFG ]; then
GIT_ROOT=$(git top pwd)
if [ -f $GIT_ROOT/$CTAGS_DIR_CFG ]; then
CTAGS_ROOT="$GIT_ROOT"
fi
fi
if [ -f $CTAGS_ROOT/$CTAGS_DIR_CFG ]; then
CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR"
else
CTAGS_SRC="$@"
fi
cd $CTAGS_ROOT
$CTAGS $CTAGS_OPT $CTAGS_SRC
cd -
}
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Run local settings.