Skip to content

Instantly share code, notes, and snippets.

@aalok-sathe
Created May 18, 2020 21:25
Show Gist options
  • Select an option

  • Save aalok-sathe/d1c235bd3c18d8db69413d845c8dbdfe to your computer and use it in GitHub Desktop.

Select an option

Save aalok-sathe/d1c235bd3c18d8db69413d845c8dbdfe to your computer and use it in GitHub Desktop.
# 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
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# 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$//'\'')"'
# view cpp docs quick
alias cppdocs="xombrero /home/aalok/Documents/cplusplus.com_book_20180311/reference/en/cpp.html &"
################################################################
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment