dotfiles

My dotfiles
git clone git://src.gearsix.net/dotfiles
Log | Files | Refs | Atom

bashrc (2956B)


      1 #!/usr/bin/env bashrc
      2 # gearsix ~/.bashrc        
      3 
      4 # exports
      5 export PS1='\[\e[1m\]\A \[\e[0m\e[3m\]\w \[\e[0m\]$ '
      6 export CC=gcc
      7 export EDITOR=nvim
      8 export GOPATH=$HOME/.go
      9 export PLAN9=/usr/local/plan9
     10 export PATH=$PATH:~/.local/bin:$GOPATH/bin:/usr/local/go/bin:$PLAN9/bin
     11 
     12 # aliases
     13 alias wbright='brightnessctl set'
     14 alias myip='curl https://ipinfo.io/ip;echo ""'
     15 alias mapscii='telnet mapscii.me'
     16 alias parrot.live='curl parrot.live'
     17 
     18 alias xopen='xdg-open'
     19 
     20 alias cls='clear'
     21 alias s!!='sudo !!'
     22 
     23 #alias rm='trash-rm -vri' # verbose, recursive, interactive
     24 alias rm='rm -vri'       # verbose, recursive, interactive
     25 alias cp='cp -vr'        # verbose, recursive
     26 alias mv='mv -vi'        # verbose, interactive
     27 alias mkd='mkdir -p'     # make parent directories
     28 
     29 # LC_COLLATE, sort by ASCII (not locale)
     30 alias l='LC_COLLATE=C ls -1h'		 # 1 column, human-readable
     31 alias ll='LC_COLLATE=C ls -lha'      # list format, human-readable, all
     32 alias lla='LC_COLLATE=C ls -lAh'     # show almost all, human-readable
     33 alias lsa='LC_COLLATE=C ls -Ah'      # list format, all, human-readable
     34 alias llt='LC_COLLATE=C ls -lAht'    # list format, show almost all, human-readable, sort by modification time (newest first)
     35 alias lls='LC_COLLATE=C ls -lAhS'    # list format, show almost all, human-readable, sort by file size (largest first)
     36 alias llu='LC_COLLATE=C ls -lAhu'    # list format, show almost all, human-readable, sort by user
     37 
     38 # open a new window instead of `less`ing it (if using gnome-terminal)
     39 if [ "$(command -v gnome-terminal)" != "" ]; then alias man='gnome-terminal -- man'; fi
     40 
     41 # valgrind options I always use
     42 alias valgrind='valgrind -s --show-leak-kinds=all --leak-check=full'
     43 
     44 # --- From other Debian bashrc
     45 
     46 # Taken from debian /usr/share/doc/bash/examples/startup-files 
     47 # don't put duplicate lines or lines starting with space in the history.
     48 HISTCONTROL=ignoreboth
     49 
     50 # append to the history file, don't overwrite it
     51 shopt -s histappend
     52 
     53 # check the window size after each command (and if necessary) update the values of LINES and COLUMNS
     54 #    shopt -s checkwinsize
     55 
     56 # if set, the pattern "**" used in a pathname expansion context will match all files and zero or more directories and subdirectories.
     57 shopt -s globstar
     58 
     59 # colored GCC warnings and errors
     60 export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
     61 
     62 # add an "alert" alias for long running commands
     63 # e.g.$ sleep 10; alert
     64 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$//'\'')"'
     65 
     66 # enable programmable completion features
     67 # don't need to enable this if it's already enabled in /etc/bash.bashrc and /etc/profile sources /etc/bash.bashrc)
     68 if ! shopt -oq posix; then
     69   if [ -f /usr/share/bash-completion/bash_completion ]; then
     70 	. /usr/share/bash-completion/bash_completion
     71   elif [ -f /etc/bash_completion ]; then
     72 	. /etc/bash_completion
     73   fi
     74 fi