Posted By

sebastian_bergmann on 05/15/08


Tagged

zsh


Versions (?)

My .zshrc


 / Published in: Bash
 

  1. # History
  2. HISTFILE=~/.zshistory
  3. HISTSIZE=2000
  4. SAVEHIST=2000
  5.  
  6. setopt appendhistory
  7. setopt sharehistory
  8. setopt hist_ignore_all_dups
  9. setopt hist_ignore_space
  10.  
  11. # Prompt
  12. autoload -U compinit promptinit
  13. compinit
  14. promptinit; prompt gentoo
  15. setopt autocd
  16.  
  17. # Completion
  18. zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
  19. zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
  20. #setopt correctall
  21.  
  22. # Key Bindings
  23. bindkey '^[[1~' beginning-of-line
  24. bindkey '^[[4~' end-of-line
  25. bindkey '^[[2~' overwrite-mode
  26. bindkey '^[[3~' delete-char
  27. bindkey '^[[6~' end-of-history
  28. bindkey '^[[5~' beginning-of-history
  29. bindkey '^[^I' reverse-menu-complete
  30. bindkey '^[OA' up-line-or-history
  31. bindkey '^[[A' up-line-or-history
  32. bindkey '^[[B' down-line-or-history
  33. bindkey '^[OB' down-line-or-history
  34. bindkey '^[OD' backward-char
  35. bindkey '^[OC' forward-char
  36. bindkey '^P' history-beginning-search-backward
  37. bindkey '^N' history-beginning-search-forward
  38. bindkey '^[[[A' run-help
  39. bindkey '^[[[B' which-command
  40. bindkey '^[[[C' where-is
  41. bindkey '^D' list-choices
  42.  
  43. # Aliases
  44. alias ..="cd .."
  45. alias df="df -Ph"
  46. alias du="du -h"
  47. alias ls="ls --color"
  48. alias ll="ls --color=always -lh"
  49. alias la="ls --color=always -lha"
  50. alias less="less -R"
  51. alias grep="grep --color=auto"
  52. alias exit="clear && exit"
  53. alias su="sudo su"
  54. alias gvim="gvim -p"
  55. alias vim="vim -p"
  56. alias diff=colordiff
  57. alias diffstat="diffstat -f2 -r2"
  58.  
  59. alias php-5.2=/usr/local/php-5.2/bin/php
  60. alias php-5.3=/usr/local/php-5.3/bin/php
  61.  
  62. alias pdepend=/usr/local/src/pdepend/pdepend.php
  63. alias phpmd=/usr/local/src/phpmd/phpmd.php
  64. alias phploc=/usr/local/src/phploc/phploc.php
  65. alias phpcpd=/usr/local/src/phpcpd/phpcpd.php
  66. alias bytekit=/usr/local/src/bytekit-cli/bytekit.php
  67. alias phpdcd=/usr/local/src/phpdcd/phpdcd.php
  68. alias phpcb=/usr/local/src/phpcb/bin/phpcb.php
  69. alias phpdep=/usr/local/src/phpdep/phpdep.php
  70. alias xt2dot=/usr/local/src/xdebug-trace-tools/xt2dot.php
  71. alias xtdiff=/usr/local/src/xdebug-trace-tools/xtdiff.php
  72. alias phpcov=/usr/local/src/code-coverage/phpcov.php
  73. alias phptok=/usr/local/src/tokenstream/phptok.php
  74.  
  75. alias ptrace="php -d xdebug.auto_trace=1 -d xdebug.trace_output_dir=`pwd`"
  76. alias pprofile="php -d xdebug.profiler_enable=1 -d xdebug.profiler_output_dir=`pwd`"
  77.  
  78. export CFLAGS="-march=native -mtune=native -O2 -fPIC -pipe"
  79. export CXXFLAGS=$CFLAGS
  80.  
  81. export EDITOR=vim
  82. export JAVA_HOME=/usr
  83. export CVS_RSH=ssh
  84. export PATH=/usr/local/php-5.3/bin:/usr/local/src/phpUnderControl/bin:/usr/lib/libming/bin:/var/lib/gems/1.8/bin:$PATH
  85. export LIBXCB_ALLOW_SLOPPY_LOCK=1
  86.  
  87. # Wrapper for "cvs diff"
  88. function cvsdiff()
  89. {
  90. cvs diff $@ | colordiff | less -R;
  91. }
  92.  
  93. # Wrapper for "svn diff"
  94. function svndiff()
  95. {
  96. svn diff -x "--ignore-all-space --ignore-eol-style --unified --show-c-function" --no-diff-deleted $@ | colordiff | less -R;
  97. }
  98.  
  99. # From http://woss.name/2007/02/01/display-svn-changelog-on-svn-up
  100. function svnrev()
  101. {
  102. svn info $@ | awk '/^Revision:/ {print $2}';
  103. }
  104.  
  105. # From http://woss.name/2007/01/01/display-svn-changelog-on-svn-up
  106. function svnup()
  107. {
  108. local old_revision=`svnrev $@`
  109. local first_update=$((${old_revision} + 1))
  110. svn up -q $@
  111. if [ $(svnrev $@) -gt ${old_revision} ]; then
  112. svn log -v -rHEAD:${first_update} $@
  113. else
  114. echo "No changes."
  115. fi
  116. }

Report this snippet  

You need to login to post a comment.