dot.zshrc 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # The following lines were added by compinstall
  2. zstyle ':completion:*' completer _complete _ignored
  3. zstyle :compinstall filename '/home/david/.zshrc'
  4. autoload -Uz compinit
  5. compinit
  6. # End of lines added by compinstall
  7. # Lines configured by zsh-newuser-install
  8. HISTFILE=~/.histfile
  9. HISTSIZE=100
  10. SAVEHIST=100
  11. setopt autocd extendedglob notify
  12. setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
  13. #setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
  14. setopt SHARE_HISTORY # Share history between all sessions.
  15. setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
  16. setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
  17. setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
  18. setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
  19. setopt HIST_VERIFY # Do not execute immediately upon history expansion.
  20. setopt APPEND_HISTORY # append to history file (Default)
  21. setopt HIST_NO_STORE # Don't store history commands
  22. setopt HIST_REDUCE_BLANKS # Remove superfluous blanks from each command line being added to the history.
  23. unsetopt beep nomatch
  24. # End of lines configured by zsh-newuser-install
  25. #
  26. zstyle ':completion:*' completer _expand _complete _correct _approximate _history
  27. zstyle ':completion:*' matcher-list '' '' 'l:|=* r:|=*' 'l:|=* r:|=*'
  28. zstyle ':completion:*' list-colors ''
  29. zstyle ':completion:*' users root
  30. zstyle ':completion:*' menu select
  31. zstyle :compinstall filename '~/.zshrc'
  32. autoload -Uz compinit
  33. autoload -U colors && colors compinit
  34. setopt auto_menu
  35. export LSCOLORS='exExcxdxcxexhxhxhxbxhx'
  36. export LS_COLORS='no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32'
  37. alias ls='ls -G'
  38. alias la='ls -A'
  39. alias ll='ls -l'
  40. alias solarized='export LSCOLORS=gxfxbEaEBxxEhEhBaDaCaD'
  41. alias basiccolor='export LSCOLORS= CxGxGgFxBxgefxBHxfdead'
  42. export TZ=Europe/Paris
  43. export GREP_COLOR='1;32'
  44. export GREP_COLORS='1;32'
  45. export GREP_OPTIONS='--color=auto'
  46. alias grep='grep --color'
  47. alias egrep='egrep --color'
  48. alias tounafon='mixer vol=100 pcm=100'
  49. alias shutup="service musicpd stop"
  50. alias vidoc='vim -c "set fileencoding=latin1"'
  51. alias getmails='imapfilter && mutt'
  52. alias thereisnoneedtoshout='musicpd && ncmpc'
  53. alias mycodes='openssl enc -bf -pbkdf2 -in ~/Dossiers/codes/Codes.enc -d -a | grep \!:1'
  54. alias listcodes='openssl enc -bf -pbkdf2 -in ~/Dossiers/codes/Codes.enc -d -a'
  55. alias meteo='curl -4 wttr.in/toulouse'
  56. alias sante='finger status@dmarec.fr'
  57. bindkey '^[[A' up-line-or-search
  58. bindkey '^[[B' down-line-or-search
  59. bindkey "^R" history-incremental-search-backward
  60. bindkey "^A" beginning-of-line
  61. bindkey "^E" end-of-line
  62. case "${TERM}" in
  63. (cons25*|linux) # PLAIN BSD/LINUX CONSOLE
  64. bindkey '\e[H' beginning-of-line # HOME
  65. bindkey '\e[F' end-of-line # END
  66. bindkey '\e[5~' delete-char # DELETE
  67. bindkey '[D' emacs-backward-word # ESC+LEFT
  68. bindkey '[C' emacs-forward-word # ESC+RIGHT
  69. ;;
  70. (*rxvt*) # RXVT DERIVATIVES
  71. precmd () { print -Pn "\e]0;%T %n@%m %c\a" }
  72. bindkey '\e[3~' delete-char # DELETE
  73. bindkey '\eOc' forward-word # CTRL+RIGHT
  74. bindkey '\eOd' backward-word # CTRL+LEFT
  75. # RXVT WORKAROUND FOR screen(1) UNDER urxvt(1)
  76. bindkey '\e[7~' beginning-of-line # HOME
  77. bindkey '\e[8~' end-of-line # END
  78. bindkey '^[[1~' beginning-of-line # HOME
  79. bindkey '^[[4~' end-of-line # END
  80. ;;
  81. (*xterm*) # XTERM DERIVATIVES
  82. precmd () { print -Pn "\e]0;%T %n@%m %c\a" }
  83. bindkey '\e[H' beginning-of-line # HOME
  84. bindkey '\e[F' end-of-line # END
  85. bindkey '\e[3~' delete-char # DELETE
  86. bindkey '\e[1;5C' forward-word # CTRL+RIGHT
  87. bindkey '\e[1;5D' backward-word # CTRL+LEFT
  88. # XTERM WORKAROUND FOR screen(1) UNDER xterm(1)
  89. bindkey '\e[1~' beginning-of-line # HOME
  90. bindkey '\e[4~' end-of-line # END
  91. ;;
  92. (screen) # GNU SCREEN
  93. bindkey '^[[1~' beginning-of-line # HOME
  94. bindkey '^[[4~' end-of-line # END
  95. bindkey '\e[3~' delete-char # DELETE
  96. bindkey '\eOc' forward-word # CTRL+RIGHT
  97. bindkey '\eOd' backward-word # CTRL+LEFT
  98. bindkey '^[[1;5C' forward-word # CTRL+RIGHT
  99. bindkey '^[[1;5D' backward-word # CTRL+LEFT
  100. ;;
  101. esac
  102. #if [ -n "${SSH_AGENT_PID}" ]; then
  103. # echo "SSH session: ${SSH_AGENT_PID} / ${SSH_AUTH_SOCK}"
  104. # ssh-add ${HOME}/.ssh/llanura
  105. #fi
  106. # [ "${TTY}" = "/dev/ttyv1" ] && exec top -s1
  107. # COLOR PROMPT
  108. cSRV="%F{magenta}"
  109. cUSR="%F{green}%B"
  110. cPMT=""
  111. cTIM="%F{cyan}%B"
  112. cPWD="%F{magenta}%B"
  113. cSTD="%b%f"
  114. export PS1="$cSRV%m$cSTD $cUSR%n$cSTD $cPWD%~$cSTD $cPMT%#$cSTD "
  115. export PS2="$cSTD $cUSR>$cSTD $cPWD"
  116. export EDITOR=vim
  117. export PAGER=less
  118. export BLOCKSIZE=K
  119. export NNTPSERVER=news.gegeweb.org
  120. export EMAIL=david@dmarec.fr
  121. export VISUAL=${EDITOR}