Guest User

Untitled

a guest
Jun 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. #!/bin/zsh
  2.  
  3. # my favorite apps to use
  4. export EDITOR='/opt/local/bin/vim'
  5. export BROWSER='open' # can be replaced by firefox or smt on Linux
  6.  
  7. # completion
  8. fpath=(~/.zshfuncs $fpath)
  9. autoload -U compinit
  10. compinit
  11.  
  12. # correction
  13. setopt correctall
  14.  
  15. # misc improvements
  16. setopt autocd
  17. setopt extendedglob
  18.  
  19. #history
  20. setopt hist_ignore_space
  21. setopt hist_ignore_all_dups
  22. export HISTSIZE=2000
  23. export HISTFILE="$HOME/.history"
  24. export SAVEHIST=$HISTSIZE
  25.  
  26. # my prompt
  27. autoload -Uz vcs_info
  28.  
  29. precmd() {
  30. psvar=()
  31. vcs_info
  32. [[ -n $vcs_info_msg_0_ ]] && psvar[1]="$vcs_info_msg_0_"
  33. }
  34.  
  35. zstyle ':vcs_info:*' formats ' %b'
  36.  
  37. PS1="%F{cyan}%n@%m%f %F{yellow}%~%f%(1v.%F{green}%1v%f.) %F{yellow}$%f "
  38.  
  39. # completion of known hosts
  40. local _myhosts
  41. _myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} )
  42. zstyle ':completion:*' hosts $_myhosts
  43.  
  44. # useful keybindings
  45. bindkey "\e[5C" forward-word # ctrl-left
  46. bindkey "\e[5D" backward-word # ctrl-right
  47. bindkey "^A" vi-beginning-of-line
  48. bindkey "^E" vi-end-of-line
  49. bindkey '^R' history-incremental-search-backward
  50. bindkey '^J' accept-line
  51.  
  52. # show matching groups
  53. zstyle ':completion:*:descriptions' format '%U%d%u'
  54. zstyle ':completion:*:warnings' format 'Sorry, no matches for: %B%d%b'
  55.  
  56. # extenstions
  57. alias -s html=$BROWSER
  58.  
  59. # settings for go lang
  60. export GOROOT=$HOME/.go
  61. export GOARCH=amd64
  62. export GOOS=darwin
  63. export GOBIN=$HOME/.go/bin
  64.  
  65. # virtualenv
  66. export WORKON_HOME=$HOME/.virtualenvs
  67. source virtualenvwrapper.sh
  68.  
  69. # ls coloring
  70. export LSCOLORS=dxfxcxdxbxegedabagacad
  71. alias ls="ls -G"
  72.  
  73. # grep coloring
  74. alias grep="grep --color"
  75.  
  76. # completing process IDs with menu selection
  77. zstyle ':completion:*:*:kill:*' menu yes select
  78. zstyle ':completion:*:kill:*' force-list always
  79.  
  80. # ignore completion functions for commands don't have
  81. zstyle ':completion:*:functions' ignored-patterns '_*'
  82.  
  83. # completion cache
  84. zstyle ':completion:*' use-cache on
  85. zstyle ':completion:*' cache-path ~/.zshcache
Add Comment
Please, Sign In to add comment