aliases 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # Collect my vim usage for _something_…
  2. # http://www.patrick-wied.at/projects/heatmap-keyboard/
  3. if command -v nvim &> /dev/null; then
  4. alias vim="nvim -w ~/.vim_keystrokes"
  5. else
  6. alias vim="vim -w ~/.vim_keystrokes"
  7. fi
  8. # God have mercy on my soul
  9. # alias vim="$HOME/bin/edit"
  10. alias e="$HOME/bin/edit"
  11. # enable color support of ls and also add handy aliases
  12. if [ -x /usr/bin/dircolors ]; then
  13. test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  14. alias ls='ls --color=auto'
  15. #alias dir='dir --color=auto'
  16. #alias vdir='vdir --color=auto'
  17. alias grep='grep --color=auto'
  18. alias fgrep='fgrep --color=auto'
  19. alias egrep='egrep --color=auto'
  20. fi
  21. alias less='less -FirSX'
  22. alias ag='ag --pager "\less -FirSX"'
  23. # Add an "alert" alias for long running commands. Use like so:
  24. # sleep 10; alert
  25. 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$//'\'')"'
  26. # Colored up cat!
  27. # Easy Insall & Pygments: sudo apt-get install python-pip && sudo pip install Pygments
  28. alias c='pygmentize -O style=monokai -f console256 -g'
  29. # I'm dumb
  30. alias rm='rm -i'
  31. alias cp='cp -i'
  32. alias mv='mv -i'
  33. alias :q='exit'
  34. # I'm <strike>smart</strike> dumb
  35. # alias cd='cd -P'
  36. # be nice
  37. alias please='sudo'
  38. # alias ll="ls -AlFh"
  39. # alias l="ls -AlFh --group-directories-first"
  40. alias l="tree --dirsfirst -ChF -L 1"
  41. alias ll=" tree --dirsfirst --timefmt='%F %H:%M:%S' -CDhFupag -L 1"
  42. alias tlog="tail -f /var/log/syslog"
  43. # View HTTP traffic
  44. alias httpdump="sudo tcpdump -i eth0 -nns 0 -w - | grep -a -E \"Host:|GET\""
  45. alias sniff="sudo ngrep -d 'eth0' -t '^(GET|POST) ' 'tcp and port 80'"
  46. alias localip="/sbin/ifconfig eth0 | awk '/inet addr:.*/ { split(\$2,a,\":\"); print a[2]; }'"
  47. # Recursively delete `.DS_Store` files
  48. alias cleanup="find . -name '*.DS_Store' -type f -ls -delete"
  49. # Shortcuts
  50. alias v="vim"
  51. alias s="svn"
  52. alias plan="$HOME/bin/edit $HOME/.dotfiles/plan"
  53. # File size
  54. alias fs="stat -c \"%s bytes\""
  55. alias sosh=". \"${HOME}/.$(basename $SHELL)rc\""
  56. # IP addresses
  57. alias extip="dig +short myip.opendns.com @resolver1.opendns.com"
  58. alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
  59. # Enhanced WHOIS lookups
  60. alias whois="whois -h whois-servers.net"
  61. # tmux colors:
  62. alias tmux="TERM=screen-256color-bce tmux"
  63. alias tls="tmux list-sessions"
  64. alias ta="tmux attach-session -t"
  65. alias td="tmux kill-session -t"
  66. # mutt colors
  67. alias mutt="TERM=screen-256color-bce mutt"
  68. alias dotfiles="cd ~/.dotfiles"
  69. alias myvimrc="vim ~/.vimrc"
  70. # SVN
  71. alias sst="svn status"
  72. alias sin="svn info"
  73. alias spl="svn pl"
  74. alias spg="svn pg"
  75. alias scom="svn commit"
  76. alias scat="svn cat"
  77. alias sdif="svn diff"
  78. alias srev="svn revert"
  79. # Git
  80. alias gst='git status'
  81. alias gc='git commit -v'
  82. alias ga='git add'
  83. alias gp='git push'
  84. alias gl='git up'
  85. alias gd='git diff'
  86. alias gg='git ack'
  87. # Will return the current branch name
  88. # Usage example: git pull origin $(current_branch)
  89. alias 'hist?'="history | grep -i"
  90. # Dumb osx
  91. if [ "$(uname -s)" = "Darwin" ]; then
  92. # French Toasting BSD sed
  93. # alias sed='gsed'
  94. # Show and hide files in Finder
  95. alias showhidden="defaults write com.apple.Finder AppleShowAllFiles YES; killall -HUP Finder"
  96. alias hidehidden="defaults write com.apple.Finder AppleShowAllFiles NO; killall -HUP Finder"
  97. alias chrome="open -a google\ chrome"
  98. alias photoshop="open -a '/Applications/Adobe Photoshop CS5/Adobe Photoshop CS5.app'"
  99. alias f='open -a Finder'
  100. # Flush Directory Service cache
  101. alias flushdns="dscacheutil -flushcache"
  102. alias mountainking="osascript -e 'say \"Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo\" using \"Cellos\"'"
  103. alias localip="ipconfig getifaddr en0"
  104. alias httpdump="sudo tcpdump -i en0 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
  105. alias sniff="sudo ngrep -d 'en0' -t '^(GET|POST) ' 'tcp and port 80'"
  106. fi
  107. # Quick scratch pad
  108. alias vpad="vim +set\ buftype=nofile +startinsert"
  109. alias vundle="vim +PluginInstall +qall"
  110. alias vundleup="vim +PluginUpdate +qall"
  111. # In honor of John
  112. alias govag="cd ~/Development/upsync4/"
  113. if command -v dnsyo > /dev/null 2>&1; then
  114. alias checkdns=dnsyo
  115. fi
  116. if command -v hiptext > /dev/null 2>&1; then
  117. alias hiptext="LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib hiptext"
  118. fi
  119. alias ny='telnet miku.acm.uiuc.edu'
  120. alias rr='curl -L http://bit.ly/10hA8iC | bash'
  121. alias sw='telnet towel.blinkenlights.nl'
  122. alias whatisit='curl "http://itsthisforthat.com/api.php?text"'
  123. alias cats="echo && curl -s -k -X GET http://placekitten.com/ | head -n 25 | tail -n 15 && echo"
  124. alias vintage='[ -r "/usr/lib/xscreensaver/apple2" ] && /usr/lib/xscreensaver/apple2 -text -fast -program bash'
  125. if command -v sshecret > /dev/null 2>&1; then
  126. alias sssh='sshecret'
  127. alias ssh='sshecret'
  128. alias scp='scp -S sshecret'
  129. fi