Guest User

Untitled

a guest
Mar 31st, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. setopt appendhistory nomatch notify
  2. setopt HIST_IGNORE_DUPS
  3. unsetopt autocd beep extendedglob
  4.  
  5. # Vim key bindings
  6. bindkey -v
  7.  
  8. # Allow e.g. ../ for tab completion
  9. zstyle ':completion:*' special-dirs true
  10.  
  11. autoload -Uz compinit
  12. compinit
  13.  
  14. CASE_SENSITIVE="true"
  15.  
  16. DISABLE_AUTO_UPDATE="true"
  17.  
  18. # History options
  19. HIST_STAMPS="yyyy-mm-dd"
  20. HISTFILE=~/.zsh_history
  21. HISTSIZE=500000
  22. SAVEHIST=500000
  23.  
  24. . ~/.shellrc
  25.  
  26. # History search
  27. [[ -n "\e[5~" ]] && bindkey "\e[5~" history-beginning-search-backward
  28. [[ -n "\e[6~" ]] && bindkey "\e[6~" history-beginning-search-forward
  29. [[ -n "\eOH" ]] && bindkey "\eOH" beginning-of-line
  30. [[ -n "\eOF" ]] && bindkey "\eOF" end-of-line
  31.  
  32. # Dirstack (use dirs -v)
  33. DIRSTACKFILE="$HOME/.cache/zsh/dirs"
  34. if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then
  35. dirstack=( ${(f)"$(< $DIRSTACKFILE)"} )
  36. #[[ -d $dirstack[1] ]] && cd $dirstack[1]
  37. fi
  38. chpwd() {
  39. print -l $PWD ${(u)dirstack} >$DIRSTACKFILE
  40. }
  41. DIRSTACKSIZE=20
  42. setopt autopushd pushdsilent pushdtohome
  43. # Remove duplicate entries
  44. setopt pushdignoredups
  45. # This reverts the +/- operators.
  46. setopt pushdminus
  47.  
  48. # Fish-like syntax highlighting
  49. . /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  50.  
  51. # Set PS1 according to server you are working on
  52. if [ $UID -eq 0 ]; then
  53. # root
  54. colorUser='196'
  55. else
  56. # normal user
  57. colorUser='46'
  58. fi
  59. colorPath='44'
  60. case "$HOST" in
  61. samson) colorServer='202';;
  62. *triumf*) colorServer='201';;
  63. lxplus*) colorServer='190';;
  64. cmslpc*) colorServer='201';;
  65. *) colorServer='141';;
  66. esac
  67.  
  68. # Personal theme
  69. PS1="%F{$colorUser}%n%{$reset_color%}@%F{$colorServer}%m %{$reset_color%}: %F{$colorPath}%~%{$reset_color%} $ "
  70. RPS1="%(?..%{$fg[red]%}%? %{$reset_color%})"
  71.  
  72. # Get colored man pages
  73. if [[ "$OSTYPE" = solaris* ]]
  74. then
  75. if [[ ! -x "$HOME/bin/nroff" ]]
  76. then
  77. mkdir -p "$HOME/bin"
  78. cat > "$HOME/bin/nroff" <<EOF
  79. #!/bin/sh
  80. if [ -n "\$_NROFF_U" -a "\$1,\$2,\$3" = "-u0,-Tlp,-man" ]; then
  81. shift
  82. exec /usr/bin/nroff -u\$_NROFF_U "\$@"
  83. fi
  84. #-- Some other invocation of nroff
  85. exec /usr/bin/nroff "\$@"
  86. EOF
  87. chmod +x "$HOME/bin/nroff"
  88. fi
  89. fi
  90.  
  91. man() {
  92. env \
  93. LESS_TERMCAP_mb=$(printf "\e[1;31m") \
  94. LESS_TERMCAP_md=$(printf "\e[1;31m") \
  95. LESS_TERMCAP_me=$(printf "\e[0m") \
  96. LESS_TERMCAP_se=$(printf "\e[0m") \
  97. LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
  98. LESS_TERMCAP_ue=$(printf "\e[0m") \
  99. LESS_TERMCAP_us=$(printf "\e[1;32m") \
  100. PAGER="${commands[less]:-$PAGER}" \
  101. _NROFF_U=1 \
  102. PATH="$HOME/bin:$PATH" \
  103. man "$@"
  104. }
Add Comment
Please, Sign In to add comment