zshrc.ohmyzsh 3.4 KB

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