Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # {{{-> bindings |
- bindkey -e
- bindkey "^[w" backward-delete-word
- bindkey "^[d" delete-word
- #bindkey "^[[2~" yank
- bindkey "^[[3~" delete-char
- bindkey "^[[5~" up-line-or-history
- bindkey "^[[6~" down-line-or-history
- bindkey "^[[1~" beginning-of-line
- bindkey "^[[4~" end-of-line
- bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
- bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
- bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
- bindkey " " magic-space ## do history expansion on space
- bindkey "^[[2~" accept-and-menu-complete
- # }}}
- # {{{-> env & other |
- # Use hard limits, except for a smaller stack and no core dumps
- unlimit
- limit stack 8192
- limit core 0
- limit -s
- export GREP_COLOR='1;33'
- export GREP_OPTIONS=' --color=auto'
- export PAGER='less -iMSx4 -FX'
- export DOWNLOADER='axel'
- export EDITOR='vim'
- export LESS_TERMCAP_mb=$'\E[01;31m'
- export LESS_TERMCAP_md=$'\E[01;31m'
- export LESS_TERMCAP_me=$'\E[0m'
- export LESS_TERMCAP_se=$'\E[0m'
- export LESS_TERMCAP_so=$'\E[01;44m'
- export LESS_TERMCAP_ue=$'\E[0m'
- if [ "`uname -s`" = 'FreeBSD' ] ; then
- export LESS_TERMCAP_us=$'\E[04;34m'
- else
- export LESS_TERMCAP_us=$'\E[04;38;5;146m'
- export PATH="$HOME/bin:$PATH"
- fi
- if [[ -z "$DISPLAY" ]]; then
- export WWW_BROWSER="links"
- else
- export WWW_BROWSER='opera %s &!'
- fi
- # }}}
- # {{{-> history |
- HISTFILE=~/.zhistory
- HISTSIZE=500
- SAVEHIST=500
- setopt APPEND_HISTORY
- setopt HIST_IGNORE_ALL_DUPS
- setopt HIST_IGNORE_SPACE
- setopt HIST_REDUCE_BLANKS
- # }}}
- # {{{-> options |
- setopt No_Beep AUTO_CONTINUE NO_CHECK_JOBS NO_HUP
- setopt notify globdots correct pushdtohome cdablevars autolist
- setopt autocd longlistjobs correctall
- setopt autoresume histignoredups pushdsilent clobber
- setopt autopushd pushdminus extendedglob rcquotes mailwarning
- unsetopt bgnice autoparamslash recexact menucomplete
- zmodload -a zsh/stat stat
- zmodload -a zsh/zpty zpty
- zmodload -a zsh/zprof zprof
- zmodload -ap zsh/mapfile mapfile
- zmodload zsh/complist
- umask 0022
- [ "`uname -s`" = 'FreeBSD' ] && hash -d etc=/usr/local/etc
- freload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done }
- autoload -U incremental-complete-word
- zle -N incremental-complete-word
- autoload -U insert-files
- zle -N insert-files
- autoload -U predict-on
- zle -N predict-on
- autoload -U pick-web-browser
- alias -s {html,htm}=pick-web-browser
- # }}}
- # {{{-> aliases |
- alias -g G='|grep'
- alias -g M='|more'
- alias -g L='|less'
- alias -g H='|head'
- alias -g T='|tail'
- alias -g N='2>/dev/null'
- alias -g IW='| iconv -c -f cp1251 -t koi8r'
- alias -g IU='| iconv -c -f utf8 -t koi8r'
- alias -g B='|bc -l'
- alias cp='nocorrect cp -vR'
- alias mv='nocorrect mv -v'
- alias rm='nocorrect rm -v'
- alias rmf='nocorrect rm -f'
- alias rmrf='nocorrect rm -fR'
- alias grep='egrep'
- alias h='history'
- alias k='kill'
- alias less='less -M -R -S'
- alias ll='ls -lap'
- alias lsa='ls -ld .*'
- alias lsd='ls -ld'
- #alias mc='/root/temp/freebsd/bin/mc-wrapper.sh'
- alias mkdir='nocorrect mkdir -pv'
- alias mkisofs='mkisofs -J -joliet-long -l -max-iso9660-filenames'
- #alias cdrecord='cdrecord -v -dev=1,0,0'
- alias nb='nb -b /usr/local/www/qw3rty.org/data --conf-file /mnt/ad6s1e/www/qw3rty.org/nb/blog.conf --data-dir /mnt/ad6s1e/www/qw3rty.org/nb/data --template-dir /mnt/ad6s1e/www/qw3rty.org/nb/templates --no-preview'
- alias nr='netstat -rna'
- alias p='ping'
- alias pa='ps axuww'
- alias pg='pa | grep'
- #alias pwg='apg -a1 -M nl -n1 -m10'
- alias q='exit'
- #alias sc='screen -Amd'
- #alias scpm='NO_GUI=1 sc portmaster -BD'
- alias su='su -'
- alias ta='tail -f'
- alias tf='tcpdump -etr'
- alias ti='tcpdump -eti'
- alias tmux='EVENT_NOKQUEUE=1 tmux'
- alias ts='trafshow -R 1 -P 10000'
- alias vim='LC_MESSAGES=C vim'
- if [ "`uname -s`" = 'FreeBSD' ] ; then
- alias ls='ls -G'
- alias ni='netstat -bnhI'
- alias pm='portmaster -BD'
- alias spm='pm --show-work'
- alias sg='sockstat | grep'
- alias top='top -PSa'
- alias w='w -n'
- else
- alias ls='ls --color=auto'
- alias sg='netstat -napA inet | grep'
- alias top='htop'
- fi
- function cl() {
- [[ -z "$1" ]] && ccze -A | less || ccze -A < "$1" | less
- }
- function tl() {
- [[ -z "$1" ]] && tail | ccze -A || tail -f "$@"| ccze -A
- }
- function gr() {
- cat | grep "$@" | grep -v grep | grep "$@"
- }
- function pwg() {
- perl -e 'for (0..($ARGV[0] || 8)) { print $chars[int rand(@chars = split("","qwertyuiopasdfghjklzxcvbnm1234567890"))]; } print "\n";' $1
- }
- # }}}
- # {{{-> completion |
- autoload -U zcalc
- autoload -U compinit promptinit
- compinit
- promptinit
- zstyle ':completion:*' menu select=long-list select=0
- zstyle ':completion:*' verbose yes
- zstyle ':completion:*' old-menu false
- zstyle ':completion:*' original true
- zstyle ':completion:*' substitute 1
- zstyle ':completion:*' use-compctl true
- zstyle ':completion:*' verbose true
- zstyle ':completion:*' word true
- zstyle ':completion:*' group-name ''
- zstyle ':completion:*' insert-unambiguous true
- zstyle ':completion:*' add-space true
- # match uppercase from lowercase
- zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
- #zstyle ':completion:*' menu yes select
- zstyle ':completion:*::::' completer _expand _complete _approximate _list
- [ -f ~/.ssh/config ] && : ${(A)ssh_config_hosts:=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
- [ -f ~/.ssh/known_hosts ] && : ${(A)ssh_known_hosts:=${${${(f)"$(<$HOME/.ssh/known_hosts)"}%%\ *}%%,*}}
- zstyle ':completion:*:*:*' hosts $ssh_config_hosts $ssh_known_hosts
- # allow one error for every three characters typed in approximate completer
- zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'
- # insert all expansions for expand completer
- zstyle ':completion:*:expand:*' tag-order all-expansions
- # formatting and messages
- zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}'
- zstyle ':completion:*:messages' format '%d'
- zstyle ':completion:*:warnings' format 'No matches for: %d'
- zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
- zstyle ':completion:*:manuals' separate-sections true
- #zstyle ':completion:*:man:*' menu yes select
- # offer indexes before parameters in subscripts
- zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
- zstyle ':completion:complete:*' use-cache 1
- # other
- zstyle ':completion:*:functions' ignored-patterns '_*'
- zstyle ':completion:*:default' list-colors 'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;31:'
- zstyle ':completion:*:processes' command 'ps -axo pid,state,start,args'
- zstyle ':completion:*:processes-names' command 'ps xho command'
- zstyle ':completion:*:*:kill:*' menu yes select
- zstyle ':completion:*:kill:*' force-list always
- zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31"
- # }}}
- # {{{-> prompt |
- setprompt () {
- setopt prompt_subst
- autoload colors zsh/terminfo
- if [[ "$terminfo[colors]" -ge 8 ]]; then
- colors
- fi
- for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
- eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
- eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
- (( count = $count + 1 ))
- done
- PR_NO_COLOUR="%{$terminfo[sgr0]%}"
- typeset -A altchar
- # set -A altchar ${(s..)terminfo[acsc]}
- # PR_SET_CHARSET="%{$terminfo[enacs]%}"
- PR_SHIFT_IN="%{$terminfo[smacs]%}"
- PR_SHIFT_OUT="%{$terminfo[rmacs]%}"
- PR_HBAR=${altchar[q]:--}
- PR_ULCORNER=${altchar[l]:--}
- PR_LLCORNER=${altchar[m]:--}
- PR_LRCORNER=${altchar[j]:--}
- PR_URCORNER=${altchar[k]:--}
- case $TERM in
- *xterm*|rxvt|(dt|k|E)term*)
- PR_TITLEBAR=$'%{\e]0;%n@%M:%~\a%}'
- stty erase '^?'
- ;;
- screen)
- #PR_TITLEBAR=$'%{\ek%n@%M:%~\e\\%}'
- #PR_TITLEBAR=$'%{\ekzsh\e\\%}'
- ;;
- *)
- PR_TITLEBAR=''
- ;;
- esac
- PROMPT='${PR_STITLE}${(e)PR_TITLEBAR}${PR_LIGHT_RED}%n${PR_LIGHT_YELLOW}@${PR_LIGHT_GREEN}%M${PR_LIGHT_YELLOW}:${PR_LIGHT_CYAN}[%~]${PR_LIGHT_RED}%#${PR_NO_COLOUR}'
- #RPROMPT='${PR_LIGHT_GREEN}(%D{%H:%M:%S} %l${PR_LIGHT_GREEN})${PR_NO_COLOUR}'
- RPROMPT='${PR_LIGHT_GREY}[%D{%H:%M:%S}/%l]${PR_NO_COLOUR}'
- }
- precmd () {
- [[ -t 1 ]] || return
- case $TERM in
- *xterm*|rxvt|(dt|k|E)term*)
- print -Pn "\e]2;%n@%M:%~\a"
- ;;
- screen)
- esac
- }
- preexec () {
- [[ -t 1 ]] || return
- case $TERM in
- *xterm*|rxvt|(dt|k|E)term*)
- print -Pn "\e]2;%n@%M:%~ ($1)\a"
- ;;
- esac
- }
- setprompt
- # }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement