The very personal dotfiles of Levi Olson.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
  1. #!/bin/bash
  2. ##################################################
  3. # .aliases
  4. # ------------
  5. # Loosly based on the amazing work of Jess Frazelle
  6. #
  7. # :author: Levi Olson
  8. # :date: 1 Feb 2018
  9. # :version: 0.0.1
  10. ##################################################
  11. # Check for various OS openers. Quit as soon as we find one that works.
  12. for opener in browser-exec xdg-open cmd.exe cygstart "start" open; do
  13. if command -v $opener >/dev/null 2>&1; then
  14. if [[ "$opener" == "cmd.exe" ]]; then
  15. # shellcheck disable=SC2139
  16. alias open="$opener /c start";
  17. else
  18. # shellcheck disable=SC2139
  19. alias open="$opener";
  20. fi
  21. break;
  22. fi
  23. done
  24. alias a='emacsclient ~/.bashrc'
  25. alias sf='source ~/.bashrc'
  26. alias ll='ls -ahl --color'
  27. alias l='ls -ahl --color'
  28. alias e='emacsclient'
  29. alias semacs='sudo emacs -Q -bg black -fg wheat --no-splash --file'
  30. alias brightness='sudo tee /sys/class/backlight/acpi_video1/brightness <<<'
  31. alias pmsyu='sudo pacman -Syu --color=auto'
  32. alias pacman='sudo pacman --color auto'
  33. alias update='sudo pacman -Syu'
  34. alias upmirrors='sudo reflector --score 100 --fastest 25 --sort rate --save /etc/pacman.d/mirrorlist --verbose'
  35. #git
  36. alias pr='git push origin HEAD'
  37. alias gaa='git add --all .'
  38. alias gcm='git commit -m'
  39. alias gc='git checkout'
  40. alias gd='git diff --patience'
  41. alias gds='git diff --staged --patience'
  42. alias st='git status'
  43. alias gl='git log --decorate'
  44. alias glb='git log --oneline --decorate --all --graph -n15'
  45. alias glv='git log --oneline --decorate --all --graph'
  46. #dirs
  47. alias thit='cd ~/Projects/work/thit-mobile-api/; clear'
  48. alias gothit='cd ~/go/src/go-thit/; clear'
  49. #docker
  50. alias dps='docker ps'
  51. alias dpsa='docker ps -a'
  52. #misc
  53. alias copy='xsel --clipboard --input'
  54. alias paste='xsel --clipboard --output'
  55. #untar
  56. alias untar='tar xvf'
  57. #afk
  58. alias afk='i3lock -c 000000'
  59. # copy file interactive
  60. alias cp='cp -i'
  61. # move file interactive
  62. alias mv='mv -i'
  63. # Intuitive map function
  64. # For example, to list all directories that contain a certain file:
  65. # find . -name .gitattributes | map dirname
  66. alias map="xargs -n1"
  67. # Stopwatch
  68. alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
  69. # Always enable colored `grep` output
  70. alias grep='grep --color=auto '
  71. # Easier navigation: .., ..., ...., ....., ~ and -
  72. alias ..="cd .."
  73. alias ...="cd ../.."
  74. alias ....="cd ../../.."
  75. alias .....="cd ../../../.."
  76. alias ~="cd ~"
  77. alias -- -="cd -"
  78. # Allow aliases to be "sudoed"
  79. alias sudo='sudo '
  80. # Mount Arch
  81. alias arch='sudo mount /dev/nvme0n1p1 /arch'