zshrc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. ## common typos
  33. alias vf='cd'
  34. alias xs='cd'
  35. alias ks='ls'
  36. alias ecgi='echo'
  37. ## folder listing/traversal
  38. alias l='ls'
  39. alias l1='ls -1'
  40. alias ll='ls -hl'
  41. alias la='ls -A'
  42. alias lal="ls -Ahl"
  43. alias l.='ls -d .[^.]*'
  44. alias lsd='ls -ld *(-/DN)'
  45. alias lg='ls -l | grep -i'
  46. alias cd..='cd ..';
  47. alias ..='cd ..'
  48. alias -g ...="../.."
  49. alias -g ....="../../.."
  50. alias -g .....="../../../.."
  51. ## file manipulation
  52. alias mkdir='nocorrect mkdir'
  53. alias mv='nocorrect mv'
  54. alias cp='nocorrect cp'
  55. alias touch='nocorrect touch'
  56. alias ln='nocorrect ln'
  57. ## host file
  58. alias hosts='vim /etc/hosts'
  59. ## preferred git shortcuts not in the git plugin
  60. alias ga.='git add .'
  61. alias gs='git status'
  62. alias gd='git diff'
  63. alias gds='git diff --staged'
  64. alias gl='git log --pretty=oneline'
  65. alias glg='git log --graph'
  66. alias glp='git log -p'
  67. alias gls='git log --stat'
  68. #############
  69. # SSH AGENT #
  70. #############
  71. # Don't do for OSX, as it has it's own handling of ssh-agent
  72. if [ `uname` != Darwin ]; then
  73. # Check to see if SSH Agent is already running
  74. agent_pid="$(ps -ef | grep "ssh-agent" | grep -v "grep" | awk '{print($2)}')"
  75. # If the agent is not running (pid is zero length string)
  76. if [[ -z "$agent_pid" ]]; then
  77. # Start up SSH Agent
  78. # this seems to be the proper method as opposed to `exec ssh-agent bash`
  79. eval "$(ssh-agent)"
  80. # if you have a passphrase on your key file you may or may
  81. # not want to add it when logging in, so comment this out
  82. # if asking for the passphrase annoys you
  83. #ssh-add
  84. # If the agent is running (pid is non zero)
  85. else
  86. # Connect to the currently running ssh-agent
  87. # this doesn't work because for some reason the ppid is 1 both when
  88. # starting from ~/.profile and when executing as `ssh-agent bash`
  89. #agent_ppid="$(ps -ef | grep "ssh-agent" | grep -v "grep" | awk '{print($3)}')"
  90. agent_ppid="$(($agent_pid - 1))"
  91. # and the actual auth socket file name is simply numerically one less than
  92. # the actual process id, regardless of what `ps -ef` reports as the ppid
  93. agent_sock="$(find /tmp -path "*ssh*" -type s -iname "agent.$agent_ppid")"
  94. echo "Agent pid $agent_pid"
  95. export SSH_AGENT_PID="$agent_pid"
  96. echo "Agent sock $agent_sock"
  97. export SSH_AUTH_SOCK="$agent_sock"
  98. fi
  99. fi
  100. ## include settings specific to this machine
  101. if [[ -r ~/.zshlocal ]]; then
  102. source ~/.zshlocal
  103. fi
  104. print -Pn "\e]1;`hostname | cut -d. -f1`\a"