Hacker News new | ask | show | jobs
by jgresty 2717 days ago
Here is my lot

  # setting common options
  alias cp='cp -iv'
  alias mv='mv -iv'
  alias rmdir='rmdir -v'
  alias ln='ln -v'
  alias ls='ls --color=auto --human-readable --group-directories-first --classify'
  alias grep='grep --color=auto'

  # shortcuts
  alias e=vim
  alias music=ncmpcpp
  alias g='git status'
  alias gp='git push'

  # show pretty git diff
  alias gitdiff='git difftool -y -x "colordiff -y -W $COLUMNS" | less -R'
  # go to root git directory
  alias cdgit='cd $(git rev-parse --show-toplevel)'
  # view csv files in columns
  alias csv='column -s, -t'
  # activate python venv
  alias v='source ./venv/bin/activate'

  # show weather
  alias weather='curl wttr.in/Manchester'
  # get my calendar
  alias c='gcalcli --calendar <redacted> --monday calw'
  # alternate view of calendar
  alias agenda='gcalcli --calendar <redacted> agenda `date --iso-8601`T08 `date --iso-8601`T15'

  # rot13 some text
  alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"

  # I always forget how to echo status code
  alias exitcode='echo $?'

  # make directory and enter it
  mdc() { mkdir -p "$@" && cd "$@"; }
  # create a file and make git track it
  ga() { touch "$@" && git add "$@" }
  # open a twitch stream in mpv
  twitch() { livestreamer --player "mpv -" "http://twitch.tv/$@" best }
  # set terminal window title
  title() { print -Pn "\e]2;$@\a" }
  # open a file with less or a directory with ls
  l() { if [ -f "$1" ]; then less "$1"; else ls "${1:-`pwd`}"; fi }
1 comments

livestreamer is dead, long live streamlink