shosei

zshrc

Mar 24th, 2012
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.25 KB | None | 0 0
  1. ### zshrc
  2.  
  3. # path to your oh-my-zsh configuration.
  4. export ZSH=$HOME/.oh-my-zsh
  5.  
  6. # set to this to use case-sensitive completion
  7. # export CASE_SENSITIVE="true"
  8. # comment this out to disable weekly auto-update checks
  9. # export DISABLE_AUTO_UPDATE="true"
  10. # uncomment following line if you want to disable colors in ls
  11. # export DISABLE_LS_COLORS="true"
  12.  
  13. # which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
  14. # example format: plugins=(rails git textmate ruby lighthouse)
  15. plugins=(git rails3 ruby dirpersist gem vi-mode)
  16.  
  17. # set to the name theme to load.
  18. # look in ~/.oh-my-zsh/themes/
  19. export ZSH_THEME="cies"
  20.  
  21. # load oh-my-zsh config framework
  22. source $ZSH/oh-my-zsh.sh
  23.  
  24. # Customize to your needs...
  25. export PATH=$HOME/bin:$HOME/github/erlang/elixir/bin:$HOME/.cabal/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  26.  
  27. # ^Q and ^S should not do what they normally do (control scrolling)
  28. # this allows some (less sophisticated) software to actually use these keys
  29. stty start undef # frees ctrl-q
  30. stty stop undef # frees ctrl-s
  31.  
  32. # set some ctrl key binds (vi modes are used otherwise)
  33. bindkey "^E" end-of-line
  34. bindkey "^A" beginning-of-line
  35. bindkey "^R" history-incremental-search-backward
  36.  
  37. # make shift-tab work like expected
  38. bindkey '^[[Z' reverse-menu-complete
  39.  
  40. # get tmux to play nice with 256 colors
  41. export TERM=xterm-256color
  42. alias tmux TERM=xterm-256color tmux
  43.  
  44. # get emecs' tramp (ssh) mode to work
  45. if [[ "$TERM" == "dumb" ]]
  46. then
  47. unsetopt zle
  48.   unsetopt prompt_cr
  49.   unsetopt prompt_subst
  50.   unfunction precmd
  51.   unfunction preexec
  52.   PS1='$ '
  53. fi
  54.  
  55. # set less options
  56. if [[ -x $(which less) ]]
  57. then
  58. export PAGER="less"
  59.   export LESS="--ignore-case --LONG-PROMPT --QUIET --chop-long-lines -Sm --RAW-CONTROL-CHARS --quit-if-one-screen --no-init"
  60.   if [[ -x $(which lesspipe.sh) ]]
  61.   then
  62. LESSOPEN="| lesspipe.sh %s"
  63.     export LESSOPEN
  64.   fi
  65. fi
  66.  
  67. # set default editor
  68. if [[ -x $(which vim) ]]
  69. then
  70. export EDITOR="vi"
  71.   export USE_EDITOR=$EDITOR
  72.   export VISUAL=$EDITOR
  73. fi
  74.  
  75. # settings for history
  76. export HISTIGNORE="&:exit:reset:clear"
  77. export HISTSIZE=25000
  78. export HISTFILE=~/.zsh_history
  79. export SAVEHIST=5000
  80. setopt INC_APPEND_HISTORY
  81. setopt HIST_IGNORE_ALL_DUPS
  82. setopt HIST_IGNORE_SPACE
  83. setopt HIST_REDUCE_BLANKS
  84. setopt HIST_VERIFY
  85.  
  86. # say how long a command took, if it took more than 30 seconds
  87. export REPORTTIME=30
  88.  
  89. # prompts for confirmation after 'rm *' etc
  90. # helps avoid mistakes like 'rm * o' when 'rm *.o' was intended
  91. setopt RM_STAR_WAIT
  92.  
  93. # quick find
  94. f() {
  95.   echo "find . -iname \"*$1*\""
  96.   find . -iname "*$1*"
  97. }
  98.  
  99. # setup ssh-agent
  100. # TODO: ssh-agents should only be run on long running sessions
  101. #zstyle :omz:plugins:ssh-agent agent-forwarding on
  102. #zstyle :omz:plugins:ssh-agent id_rsa # add more space separated identities
  103.  
  104. # ack id often only available as ack-grep
  105. alias ack="ack-grep"
  106.  
  107. # the following lines set up rvm for the current shell session
  108. # it gives precendence to local installs over global installs of rvm
  109. # and enables the default ruby as set with "rvm use <ID> --default"
  110. # make sure these come after setting the PATH!
  111. [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" # global
  112. [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # local
Advertisement
Add Comment
Please, Sign In to add comment