#!/usr/bin/env bashrc
# gearsix ~/.bashrc        

# exports
export PS1='\[\e[1m\]\A \[\e[0m\e[3m\]\w \[\e[0m\]$ '
export CC=gcc
export EDITOR=nvim
export GOPATH=$HOME/.go
export PLAN9=/usr/local/plan9
export PATH=$PATH:~/.local/bin:$GOPATH/bin:/usr/local/go/bin:$PLAN9/bin

# aliases
alias wbright='brightnessctl set'
alias myip='curl https://ipinfo.io/ip;echo ""'
alias mapscii='telnet mapscii.me'
alias parrot.live='curl parrot.live'

alias xopen='xdg-open'

alias cls='clear'
alias s!!='sudo !!'

#alias rm='trash-rm -vri' # verbose, recursive, interactive
alias rm='rm -vri'       # verbose, recursive, interactive
alias cp='cp -vr'        # verbose, recursive
alias mv='mv -vi'        # verbose, interactive
alias mkd='mkdir -p'     # make parent directories

# LC_COLLATE, sort by ASCII (not locale)
alias l='LC_COLLATE=C ls -1h'		 # 1 column, human-readable
alias ll='LC_COLLATE=C ls -lha'      # list format, human-readable, all
alias lla='LC_COLLATE=C ls -lAh'     # show almost all, human-readable
alias lsa='LC_COLLATE=C ls -Ah'      # list format, all, human-readable
alias llt='LC_COLLATE=C ls -lAht'    # list format, show almost all, human-readable, sort by modification time (newest first)
alias lls='LC_COLLATE=C ls -lAhS'    # list format, show almost all, human-readable, sort by file size (largest first)
alias llu='LC_COLLATE=C ls -lAhu'    # list format, show almost all, human-readable, sort by user

# open a new window instead of `less`ing it (if using gnome-terminal)
if [ "$(command -v gnome-terminal)" != "" ]; then alias man='gnome-terminal -- man'; fi

# valgrind options I always use
alias valgrind='valgrind -s --show-leak-kinds=all --leak-check=full'

# --- From other Debian bashrc

# Taken from debian /usr/share/doc/bash/examples/startup-files 
# don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# check the window size after each command (and if necessary) update the values of LINES and COLUMNS
#    shopt -s checkwinsize

# if set, the pattern "**" used in a pathname expansion context will match all files and zero or more directories and subdirectories.
shopt -s globstar

# colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# add an "alert" alias for long running commands
# e.g.$ 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$//'\'')"'

# enable programmable completion features
# 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
