add all vim configs, update vim config
[cinan.git] / .zshrc
blob4b41bc84ac95ac0387e159ecc8b89f87c2f59595
1 export TERM=xterm-256color
2 export HISTFILE=~/.zsh_history
3 export HISTSIZE=10000
4 export SAVEHIST=10000
5 eval `dircolors -b`
7 autoload -U compinit promptinit
8 compinit
9 promptinit
10 setopt ALWAYS_TO_END AUTO_LIST NO_LIST_BEEP SH_WORD_SPLIT
11 setopt NOMATCH BAD_PATTERN
12 setopt localoptions 
13 setopt NO_BEEP CD_ABLE_VARS 
14 setopt CORRECT APPEND_HISTORY
16 #zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
17 zstyle ':completion:*:*:kill:*' command 'ps -au$USER -o pid,%cpu,cmd'
18 zstyle ':completion:*' completer _expand _complete _correct
19 zstyle ':completion:*' format '%d:'
20 zstyle ':completion:*' group-name ''
21 zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*'
22 #zstyle ':completion:*' max-errors 3
23 zstyle ':completion:*' menu select=2 yes=long-list
24 zstyle ':completion:*' prompt 'Alternatives %e:'
25 zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
26 zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
27 zstyle ':completion:*:cd:*' ignore-parents parent pwd
28 #zstyle ':completion::*:(rm|vim|cp|mv):*' ignore-line true
30 autoload -U colors
31 colors
32 highlights='${PREFIX:+=(#bi)($PREFIX:t)(?)*==$color[cyan]=$color[none];$color[none]}':${(s.:.)LS_COLORS}}
34 zstyle -e ':completion:*' list-colors 'reply=( "'$highlights'" )'
35 unset highlights
37 # use colors when browsing man pages (if not using pinfo or PAGER=most)
38 [ -d ~/.terminfo/ ] && alias man='TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man'
40 # key bindings
41 bindkey -e
42 bindkey "\e[1~" beginning-of-line
43 bindkey "\e[4~" end-of-line
44 bindkey "\e[5~" beginning-of-history
45 bindkey "\e[6~" end-of-history
46 bindkey "\e[3~" delete-char
47 bindkey "\e[2~" quoted-insert
48 bindkey "\e[5C" forward-word
49 bindkey "\eOc" emacs-forward-word
50 bindkey "\e[5D" backward-word
51 bindkey "\eOd" emacs-backward-word
52 bindkey "\e\e[C" forward-word
53 bindkey "\e\e[D" backward-word
54 bindkey "^W" backward-delete-word
55 bindkey "^?"    backward-delete-char
56 bindkey "^H"    backward-delete-char
57 # for rxvt
58 bindkey "\e[8~" end-of-line
59 bindkey "\e[7~" beginning-of-line
60 # for non RH/Debian xterm, can't hurt for RH/DEbian xterm
61 bindkey "\eOH" beginning-of-line
62 bindkey "\eOF" end-of-line
63 # for freebsd console
64 bindkey "\e[H" beginning-of-line
65 bindkey "\e[F" end-of-line
66 # completion in the middle of a line
67 bindkey '^i' expand-or-complete-prefix
69 bindkey "^A" beginning-of-line
70 bindkey "^E" end-of-line
71 bindkey "^b" backward-word
72 bindkey "^f" forward-word
73 bindkey "^k" kill-line
74 bindkey ' ' magic-space    # also do history expansion on space
75 # bindkey '^I' complete-word # complete on tab, leave expansion to _expand
78 #FUNCTIONS
80 #find out ATI card temperature and set fan speed
81 function teplota { LD_PRELOAD=libXinerama.so.1 aticonfig --od-gettemperature; }
82 function fan() { aticonfig --pplib-cmd "set fanspeed 0 $1"; }
84 function ext () {
85     if [[ "$#" == "1" ]]; then
86         if [[ -f $1 ]]; then
87             case $1 in
88                 *.tar.bz2)   tar xvjf $1    ;;
89                 *.tar.gz)    tar xvzf $1    ;;
90                 *.bz2)       bunzip2 $1     ;;
91                 *.rar)       unrar x $1     ;;
92                 *.gz)        gunzip $1      ;;
93                 *.tar)       tar xvf $1     ;;
94                 *.tbz2)      tar xvjf $1    ;;
95                 *.tgz)       tar xvzf $1    ;;
96                 *.zip)       unzip $1       ;;
97                 *.Z)         uncompress $1  ;;
98                 *.7z)        7z x $1        ;;
99                 *)           echo "don't know how to extract '$1'..." ;;
100             esac
101         else
102             echo "'$1' is not a valid file!"
103         fi
104     else
105         echo "Must provide only one argument!"
106     fi
109 alias ls="ls --color -h"
110 #alias editt="sudo vi /usr/share/themes/openbox_cinan/openbox-3/themerc"
111 #alias pal="xterm -hold -bg black -fg white -geometry 37x12 -e pal"
112 alias pacman="pacman2"
113 alias du="du -hs"
114 alias df="df -h"
115 alias grep="grep --colour -i"
116 alias rubysearch="ruby ~/skripty/search_interface.rb"
117 alias vi="vim -u ~/.vimrc"
118 alias more="vim -u /usr/share/vim/vim72/macros/less.vim"
119 alias less="vim -u /usr/share/vim/vim72/macros/less.vim"
120 alias rtorrent="rtorrent -o http_capath=/etc/ssl/certs"
121 alias smplayer="smplayer 2>/dev/null"
122 export m="/media/data/"
123 export M="/media/data2/"
124 alias "true-combat"="fan 50; true-combat.alsa; fan 3;"
125 #alias soffice="env GTK2_RC_FILES=/usr/share/themes/Redmond/gtk-2.0/gtkrc env OOO_FORCE_DESKTOP=gnome soffice"
126 alias t="vim -c :TodoOpen -c :q -c ':noremap q :q<CR>'"
127 alias toclip="xclip -selection clipboard"
128 alias fromclip="xclip -selection clipboard -o"
129 alias newsbeuter="TERM=xterm newsbeuter"
132 autoload zsh/terminfo
133 #for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
134 for color in RED CYAN; do
135     eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
136     #eval PR__$color='%{$fg[${(L)color}]%}'
137 #    (( count = $count + 1 ))
138 done
139 PR_NO_COLOUR="%{$terminfo[sgr0]%}"
141 if [ `id -u` -eq 0 ]
142 then
143     PS1="[${PR_RED} %/ $PR_NO_COLOUR]═> "
144 else
145     PS1="[${PR_CYAN} %/ ${PR_NO_COLOUR}]═> "