default_aliases 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # Keep in dots/aliases & Source
  2. host=$(hostname)
  3. hostname="${host^^}"
  4. repo_directory="/opt/qconfig"
  5. # Colored Prompts
  6. alias ls='ls --color=auto'
  7. alias dir='dir --color=auto'
  8. alias vdir='vdir --color=auto'
  9. alias grep='grep --color=auto'
  10. alias fgrep='fgrep --color=auto'
  11. alias egrep='egrep --color=auto'
  12. # colored GCC warnings and errors
  13. export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
  14. # Aliases
  15. if [ -e "/opt/qbins/eza" ]; then
  16. alias ls="eza"
  17. fi
  18. alias cls="clear && pwd && ls"
  19. alias ll="ls -lh"
  20. alias la="ls -lah"
  21. alias oo="open . || xdg-open ."
  22. alias ex="exit"
  23. alias qq="exit"
  24. alias mv="mv -iv"
  25. alias cp="cp -riv"
  26. alias mkdir="mkdir -vp"
  27. alias rm="rm -i"
  28. alias b="cd .."
  29. alias bls="cd .. && ls"
  30. alias bb="cd ../../"
  31. alias bbls="cd ../../ && ls"
  32. alias cl="clear"
  33. alias cdl="cd && cl"
  34. alias v="vim"
  35. alias vim="nvim -R"
  36. alias vime="nvim"
  37. alias py="python3"
  38. alias py2="python2"
  39. alias py3="python3"
  40. alias s="sudo"
  41. function checkenv() {
  42. if [ -n "$PIPENV_ACTIVE" ]; then
  43. echo "Pipenv Environment Active"
  44. echo "$VIRTUAL_ENV"
  45. fi
  46. }
  47. alias ce="checkenv"
  48. alias editsource="vim ~/.bashrc"
  49. alias editdalias="vim ~/dots/default_aliases"
  50. function editualias() {
  51. if [ -f "$repo_directory/user_aliases" ]; then
  52. vim "$repo_directory/user_aliases"
  53. sp
  54. else
  55. vim ~/.dots/user_aliases
  56. sp
  57. fi
  58. }
  59. function editpaths() {
  60. if [ -f "$repo_directory/user_paths" ]; then
  61. vim "$repo_directory/user_paths"
  62. sp
  63. else
  64. vim ~/.dots/user_paths
  65. sp
  66. fi
  67. }
  68. if [ -d "/opt/qconfig" ]; then
  69. alias uqconfig="cd /opt/qconfig/"
  70. fi
  71. alias sourceprofile="source ~/.bashrc"
  72. alias sourcepro="sourceprofile"
  73. alias sp="sourcepro"
  74. alias internetSpeedTest="wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip"
  75. alias ufwcmd="echo 'ufw allow proto tcp from 0.0.0.0 port 00 to 0.0.0.0 port 00 comment'"
  76. alias weather="curl http://wttr.in/hk"
  77. alias publicip="curl ipinfo.io"
  78. alias graph="git log --all --decorate --oneline --graph"
  79. alias gs="git status"
  80. alias gl="git log"
  81. alias gd="git diff"
  82. alias gf="git fetch"
  83. alias ga="git add ."
  84. alias gb="git branch"
  85. alias gch="git checkout"
  86. alias gp="git push"
  87. alias gpl="git fetch && git pull"
  88. alias gc="git commit -am 'quick updates'"
  89. alias gcp="git commit -am 'quick updates' && git push"
  90. alias gcm="git commit -m"
  91. alias dlvid="yt-dlp"
  92. alias dlmp3="yt-dlp -x --audio-format mp3"
  93. alias dlflac="yt-dlp -x --audio-format flac"
  94. alias dlplaylist='yt-dlp --output "%(playlist_index)s.%(title)s.%(ext)s"'
  95. export EDITOR=/usr/bin/nvim
  96. #eval `keychain --agents ssh --eval id_rsa`