Advertisement
Guest User

My .zshrc Config File (https://youtube.com/c/cognitivesurge)

a guest
Jul 13th, 2019
8,612
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. export ZSH="/Users/karl/.oh-my-zsh"
  2.  
  3. ZSH_THEME="robbyrussell"
  4.  
  5. plugins=(
  6. git
  7. bundler
  8. dotenv
  9. osx
  10. rake
  11. zsh-autosuggestions
  12. last-working-dir
  13. web-search
  14. cloudfoundry
  15. )
  16.  
  17. # https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md
  18. source $ZSH/oh-my-zsh.sh
  19. source /Users/karl/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  20.  
  21. # z extension for browsing
  22. . ~/z.sh
  23.  
  24. # user configuration
  25. # custom aliases
  26. alias c="code .";
  27. alias ll="ls -1a";
  28. alias ..="cd ../";
  29. alias ..l="cd ../ && ll";
  30. alias pg="echo 'Pinging Google' && ping www.google.com";
  31. alias de="cd ~/Desktop";
  32. alias dd="cd ~/code";
  33. alias d="cd ~/code && cd "
  34. alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
  35. alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
  36. alias deleteDSFiles="find . -name '.DS_Store' -type f -delete"
  37. alias npm-update="npx npm-check -u";
  38. alias flushdns="sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder"
  39.  
  40. ## git aliases
  41. function gc { git commit -m "$@"; }
  42. alias gcm="git checkout master";
  43. alias gs="git status";
  44. alias gpull="git pull";
  45. alias gf="git fetch";
  46. alias gfa="git fetch --all";
  47. alias gf="git fetch origin";
  48. alias gpush="git push";
  49. alias gd="git diff";
  50. alias ga="git add .";
  51. alias gb="git branch";
  52. alias gbr="git branch remote"
  53. alias gfr="git remote update"
  54. alias gbn="git checkout -B "
  55. alias grf="git reflog";
  56. alias grh="git reset HEAD~" # last commit
  57. alias gac="git add . && git commit -a -m "
  58. alias gsu="git gpush --set-upstream origin "
  59. alias glog="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches"
  60.  
  61. ## checkout a new remote branch (exists remote, not locally)
  62. ## git checkout -b LocalName origin/remotebranchname (checkout a remote branch)
  63.  
  64. ## npm aliases
  65. alias ni="npm install";
  66. alias nrs="npm run start -s --";
  67. alias nrb="npm run build -s --";
  68. alias nrd="npm run dev -s --";
  69. alias nrt="npm run test -s --";
  70. alias nrtw="npm run test:watch -s --";
  71. alias nrv="npm run validate -s --";
  72. alias rmn="rm -rf node_modules";
  73. alias flush-npm="rm -rf node_modules && npm i && echo NPM is done";
  74.  
  75. ## yarn aliases
  76. alias yar="yarn run"; # lists all the scripts we have available
  77. alias yab="yarn build"; # build dist directory for each package
  78. alias yal="yarn lint:fix"; # format source and auto-fix eslint issues
  79. alias yac="yarn commit"; # open a Q&A prompt to help construct valid commit messages
  80. alias yas="yarn start";
  81. alias yasb="yarn storybook:start"; # start storybook
  82. alias yat="yarn test"; # run the unit tests*
  83. alias yatw="yarn test:watch"; #run the unit tests for files changed on save
  84.  
  85. ## docker
  86. alias dockerstop='docker-compose stop'
  87. alias dockerrestart='docker-compose restart'
  88. alias dockerup='docker-compose up -d'
  89. alias dockerrm='docker-compose rm --all'
  90.  
  91. ## other aliases
  92. alias zshrc='code ~/.zshrc'
  93. alias topten="history | commands | sort -rn | head"
  94. alias myip="curl http://ipecho.net/plain; echo"
  95. alias dirs='dirs -v | head -10'
  96. alias usage='du -h -d1'
  97. alias update="source ~/.zshrc"
  98. alias sshdir="cd ~/.ssh"
  99. alias runp="lsof -i "
  100. alias md="mkdir "
  101. alias ..='cd ..'
  102. alias ...='cd ../..'
  103.  
  104. ## this loads NVM
  105. [[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
  106.  
  107. ## custom functions
  108. gpr() {
  109. if [ $? -eq 0 ]; then
  110. github_url=`git remote -v | awk '/fetch/{print $2}' | sed -Ee 's#(git@|git://)#http://#' -e 's@com:@com/@' -e 's%\.git$%%'`;
  111. branch_name=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3`;
  112. pr_url=$github_url"/compare/master..."$branch_name
  113. open $pr_url;
  114. else
  115. echo 'failed to open a pull request.';
  116. fi
  117. }
  118.  
  119. commands() {
  120. awk '{a[$2]++}END{for(i in a){print a[i] " " i}}'
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement