1
0

zshrc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. eval "$(dircolors -b ~/.dircolors)"
  2. autoload -Uz compinit
  3. compinit
  4. zmodload -a complist
  5. zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  6. zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
  7. zstyle ':completion:*' use-compctl false
  8. zstyle ':completion:*' use-cache on
  9. zstyle ':completion:*' cache-path ~/.zshcache
  10. __git_files () {
  11. _wanted files expl 'local files' _files
  12. }
  13. zstyle :compinstall filename "$HOME/.zshrc"
  14. HISTFILE=~/.histfile
  15. HISTSIZE=10000
  16. SAVEHIST=10000
  17. setopt no_beep
  18. setopt extendedglob
  19. #setopt print_exit_value
  20. setopt prompt_subst
  21. setopt complete_in_word
  22. setopt no_auto_menu
  23. setopt no_always_last_prompt
  24. setopt share_history
  25. setopt hist_ignore_all_dups
  26. setopt hist_ignore_space
  27. setopt extended_history
  28. setopt promptsubst
  29. setopt autopushd
  30. setopt pushdignoredups
  31. setopt nomatch
  32. autoload -U edit-command-line
  33. zle -N edit-command-line
  34. bindkey -e
  35. bindkey '^[[3~' delete-char
  36. bindkey '^[[1;5C' forward-word
  37. bindkey '^[[1;5D' backward-word
  38. bindkey '\C-v' edit-command-line
  39. bindkey '\Ea' push-line
  40. local WORDCHARS=${WORDCHARS//\//}\| # remove forward slash, add pipe
  41. autoload colors
  42. colors
  43. bright_cyan='%{%}' # not provided by colors
  44. autoload -Uz vcs_info
  45. zstyle ':vcs_info:*' unstagedstr "%{$fg[red]%}*"
  46. zstyle ':vcs_info:*' stagedstr "%{$fg[red]%}+"
  47. zstyle ':vcs_info:*' formats "$bright_cyan%b%u%c"
  48. zstyle ':vcs_info:*' actionformats "$bright_cyan%b%u%c|%a"
  49. zstyle ':vcs_info:git:*' check-for-changes true
  50. zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b:%r'
  51. zstyle ':vcs_info:bzr:*' use-simple true
  52. zstyle ':vcs_info:*' enable git hg bzr svn cvs
  53. precmd () { vcs_info }
  54. PROMPT="%{$fg_bold[grey]%}%* " # time
  55. PROMPT+="%{${fg_bold[green]}%}%m%{${reset_color}%}:" # host
  56. PROMPT+="%{${fg_bold[blue]}%}%50<...<%~%<<%{${reset_color}%} " # path
  57. PROMPT+='${vcs_info_msg_0_} '
  58. PROMPT+="%(?..%{$fg_bold[red]%}%? %{$reset_color%})" # exit status
  59. PROMPT+="%1(j.%{$fg[green]%}%j .)" # suspended jobs
  60. PROMPT+=$'%{$reset_color%} \n%(!.#.\$) '
  61. autoload -U url-quote-magic
  62. zle -N self-insert url-quote-magic
  63. source $HOME/.zsh_paste
  64. export EDITOR=vi
  65. export MANPAGER="/bin/sh -c \"col -bx | vim -c 'set ft=man' -\""
  66. export GREP_COLORS='ms=01;36:mc=01;31:sl=:cx=:fn=35:ln=33:bn=33:se=01;34'
  67. alias ls='ls --color=auto -hv --group-directories-first'
  68. alias ll='ls -l'
  69. alias l.='ls -Ad .*'
  70. alias la='ls -A'
  71. alias llr='lr -1AGl -ov'
  72. alias grep='grep --color -s'
  73. alias df='df -hx tmpfs'
  74. alias du='du --max-depth=1'
  75. alias sr='screen -r'
  76. alias gip='git pull --ff-only'
  77. alias gil='git log --graph --abbrev-commit --stat --summary -C --decorate --date=local'
  78. alias gib='git branch -a'
  79. alias gis='git status'
  80. alias gid='git diff -C --date=local'
  81. alias giw='git show -C --date=local --decorate'
  82. alias gic='git checkout'
  83. alias giu='git reset HEAD\^'
  84. alias gn='git number'
  85. alias hgw='hg diff --change .'
  86. alias class='xprop -notype WM_CLASS'
  87. alias tree='tree -AvL 10'
  88. alias vi='vi -p'
  89. alias vil='vi *(.om[1])'
  90. alias dt='gnome-terminal --hide-menubar'
  91. alias sudovi="sudo vi -N -u $HOME/.vimrc"
  92. alias shrug="echo -n '¯\\(°_o)/¯' | xclip -selection clipboard"
  93. function https() {
  94. openssl s_client -connect $1:443 -servername $1 < /dev/null | \
  95. openssl x509 -noout -text -certopt no_header,no_version,no_serial,no_signame,no_pubkey,no_sigdump
  96. }
  97. function cl() {
  98. if [ $# = 0 ]; then
  99. cd && ls
  100. else
  101. cd "$*" && ls
  102. fi
  103. }
  104. function pdf() {
  105. atril "$*" &> /dev/null &!
  106. }
  107. export GOPATH=$HOME/go
  108. export PYTHONSTARTUP=$HOME/.pystartup.py
  109. export VIRTUAL_ENV="/home/raylu/venv"
  110. #NPM_PACKAGES="$HOME/npm-packages"
  111. #export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
  112. PATH=$VIRTUAL_ENV/bin:$NPM_PACKAGES/bin:$PATH
  113. if [ -d $HOME/bin ]; then
  114. PATH=$HOME/bin:$PATH
  115. fi
  116. if [ -x /usr/bin/fzf ]; then
  117. source "/usr/share/doc/fzf/examples/key-bindings.zsh"
  118. fi
  119. stty stop undef