From 841f2cb5f0a3976f35099dcff2711f9b02976fd1 Mon Sep 17 00:00:00 2001 From: Jannik Zander <59698@grundfos.com> Date: Thu, 12 Jul 2018 13:54:18 +0200 Subject: [PATCH] Minor update --- .bash_aliases | 28 +++++++++++++--------------- .bashrc | 17 +++++++++-------- .profile | 13 +++++++------ 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index 18d684b..95bb00d 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,27 +1,25 @@ -# ls with coloring +# enable color support of ls and also add handy aliases lsflags="-hF" -# Detect which `ls` flavor is in use -if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls` - colorflag="--color=auto" - lsflags="$lsflags -I NTUSER.\* -I ntuser.\*" -else # OS X `ls` - export CLICOLOR=1 - colorflag="-G" +if [ -x "$(which dircolors 2>/dev/null)" ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + lsflags="$lsflags -I NTUSER.\* -I ntuser.\*" + colorflag="--color=auto" + alias grep='grep --color=auto' + alias egrep='egrep --color=auto' + alias fgrep='fgrep --color=auto' +else # OSX version of ls + export CLICOLOR=1 + colorflag="-G" fi alias ls="ls $colorflag $lsflags" -alias sl=ls -alias l='ls -CF' -alias la='ls -A' alias ll='ls -l' +alias la='ls -A' +alias l='ls -CF' alias l1='ls -1' alias l.='ls -d .[a-z]*' -# grep and less with coloring -alias grep='grep --color=auto' -alias egrep='egrep --color=auto' -alias fgrep='fgrep --color=auto' alias less='less -m -N -g -i -J --underline-special --SILENT -X' alias more='less' diff --git a/.bashrc b/.bashrc index 3d46d39..7c83cab 100644 --- a/.bashrc +++ b/.bashrc @@ -7,9 +7,17 @@ cd ~ set -o vi +# Set unlimited history +HISTFILESIZE= +HISTSIZE= +HISTCONTROL=ignoreboth:erasedups +HISTTIMEFORMAT="[%F %T] " +HISTFILE=~/.bash_history.local + # Use 'help shopt' to see the documentation for the given options shopt -s autocd shopt -s cdspell +shopt -s checkwinsize shopt -s cmdhist shopt -s dotglob shopt -s globstar @@ -44,15 +52,8 @@ GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUPSTREAM='auto' GIT_PS1_HIDE_IF_PWD_IGNORED=1 -# Set unlimited history -HISTFILESIZE= -HISTSIZE= -HISTCONTROL=ignoreboth:erasedups -HISTTIMEFORMAT="[%F %T] " -HISTFILE=~/.bash_history.local PROMPT_COMMAND="history -a; $PROMPT_COMMAND" - # Load completion, aliases, and local settings -[ -f ~/.bash_completion ] && . ~/.bash_completion; [ -f ~/.bash_aliases ] && . ~/.bash_aliases; +[ -f ~/.bash_completion ] && . ~/.bash_completion; [ -f ~/.bashrc.local ] && . ~/.bashrc.local diff --git a/.profile b/.profile index 9144e3b..5113237 100644 --- a/.profile +++ b/.profile @@ -1,7 +1,12 @@ # .profile is for things not specifically related to Bash, like environment variables PATH and others, and should be available anytime. -# set PATH so it includes user's private bin -export PATH=~/bin:$PATH +# call shell specific settings +if [ ! "x${BASH_VERSION}" = "x" ]; then + [ -f ~/.bashrc ] && . ~/.bashrc +fi + +# set PATH so it includes local bin's +export PATH=~/.local/bin:~/bin:$PATH export TMP=~/.cache export TEMP=$TMP @@ -39,7 +44,3 @@ export LESS=" -R " # colored GCC warnings and errors export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' -# call shell specific settings -if [ ! "x${BASH_VERSION}" = "x" ]; then - [ -f ~/.bashrc ] && . ~/.bashrc -fi -- 2.43.0