zshrc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. # Path to your oh-my-zsh configuration.
  2. ZSH=$HOME/dotfiles/zsh/oh-my-zsh
  3. ZSH_CUSTOM=$HOME/dotfiles/zsh/oh-my-zsh-custom
  4. # Set name of the theme to load.
  5. # Look in ~/.oh-my-zsh/themes/
  6. # Optionally, if you set this to "random", it'll load a random theme each
  7. # time that oh-my-zsh is loaded.
  8. ZSH_THEME="cinaeco"
  9. # Example aliases
  10. # alias zshconfig="mate ~/.zshrc"
  11. # alias ohmyzsh="mate ~/.oh-my-zsh"
  12. # Set to this to use case-sensitive completion
  13. # CASE_SENSITIVE="true"
  14. # Comment this out to disable weekly auto-update checks
  15. DISABLE_AUTO_UPDATE="true"
  16. # Uncomment following line if you want to disable colors in ls
  17. # DISABLE_LS_COLORS="true"
  18. # Uncomment following line if you want to disable autosetting terminal title.
  19. DISABLE_AUTO_TITLE="true"
  20. # Uncomment following line if you want red dots to be displayed while waiting for completion
  21. # COMPLETION_WAITING_DOTS="true"
  22. # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
  23. # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
  24. # Example format: plugins=(rails git textmate ruby lighthouse)
  25. plugins=(git vi-mode)
  26. source $ZSH/oh-my-zsh.sh
  27. # Customize to your needs...
  28. ## history
  29. alias h='history'
  30. ## don't show expansions, just execute, e.g. for !! and !$
  31. setopt nohistverify
  32. ## don't have the same history across tabs/windows
  33. setopt nosharehistory
  34. ## folder listing/traversal
  35. alias l='ls'
  36. alias ll='ls -hl'
  37. alias la='ls -A'
  38. alias lal="ls -Ahl"
  39. alias cd..='cd ..';
  40. alias ..='cd ..'
  41. alias -g ...="../.."
  42. alias -g ....="../../.."
  43. alias -g .....="../../../.."
  44. ## file manipulation
  45. alias mkdir='nocorrect mkdir'
  46. alias mv='nocorrect mv'
  47. alias cp='nocorrect cp'
  48. alias touch='nocorrect touch'
  49. alias ln='nocorrect ln'
  50. ## host file
  51. alias hosts='vim /etc/hosts'
  52. ## preferred git shortcuts not in the git plugin
  53. alias ga.='git add .'
  54. alias gs='git status'
  55. alias gd='git diff'
  56. alias gds='git diff --staged'
  57. alias gl='git log --graph --date=relative --pretty="format:%C(yellow)%h %Cblue[%cn] %Creset%s... %cd"'
  58. alias gls='git log --graph --stat'
  59. alias glp='git log -p'
  60. alias gr='git rebase'
  61. # useful git plugin built-in ones include:
  62. # gc, gco, gb, gba, gm, grhh, ggpull, ggpush
  63. # ggpull translates into `git pull origin <current branch>`, same for ggpush
  64. #############
  65. # SSH AGENT #
  66. #############
  67. # Don't do for OSX, as it has it's own handling of ssh-agent
  68. if [ `uname` != Darwin ]; then
  69. # Check to see if SSH Agent is already running
  70. agent_pid="$(ps -ef | grep "ssh-agent" | grep -v "grep" | awk '{print($2)}')"
  71. # If the agent is not running (pid is zero length string)
  72. if [[ -z "$agent_pid" ]]; then
  73. # Start up SSH Agent
  74. # this seems to be the proper method as opposed to `exec ssh-agent bash`
  75. eval "$(ssh-agent)"
  76. # if you have a passphrase on your key file you may or may
  77. # not want to add it when logging in, so comment this out
  78. # if asking for the passphrase annoys you
  79. #ssh-add
  80. # If the agent is running (pid is non zero)
  81. else
  82. # Connect to the currently running ssh-agent
  83. # this doesn't work because for some reason the ppid is 1 both when
  84. # starting from ~/.profile and when executing as `ssh-agent bash`
  85. #agent_ppid="$(ps -ef | grep "ssh-agent" | grep -v "grep" | awk '{print($3)}')"
  86. agent_ppid="$(($agent_pid - 1))"
  87. # and the actual auth socket file name is simply numerically one less than
  88. # the actual process id, regardless of what `ps -ef` reports as the ppid
  89. agent_sock="$(find /tmp -path "*ssh*" -type s -iname "agent.$agent_ppid")"
  90. echo "Agent pid $agent_pid"
  91. export SSH_AGENT_PID="$agent_pid"
  92. echo "Agent sock $agent_sock"
  93. export SSH_AUTH_SOCK="$agent_sock"
  94. fi
  95. fi
  96. ## include settings specific to this machine
  97. if [[ -r ~/.zshlocal ]]; then
  98. source ~/.zshlocal
  99. fi