Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # location of history
- export HISTFILE=~/.histfile
- # number of lines kept in history
- export HISTSIZE=10000
- # number of lines saved in the history after logout
- export SAVEHIST=10000
- export EDITOR="nano"
- # emacs style key binding
- bindkey -e
- # backward delete
- # chars as part of filename
- WORDCHARS='*?_-[]~=&;!#$%^(){}<>'
- bindkey "^[OH" beginning-of-line
- bindkey "^[OF" end-of-line
- bindkey "^[[3~" delete-char
- bindkey "^[[5~" beginning-of-history
- bindkey "^[[6~" end-of-history
- bindkey "^[[1;5C" forward-word
- bindkey "^[[1;5D" backward-word
- bindkey "^[[1;3C" forward-word
- bindkey "^[[1;3D" backward-word
- autoload -Uz compinit
- compinit
- # End of lines added by compinstall
- #Disable core dumps
- limit coredumpsize 0
- setopt AUTO_LIST
- setopt AUTO_MENU
- setopt MENU_COMPLETE
- setopt autocd
- setopt extendedglob
- setopt hist_ignore_all_dups
- autoload -U compinit
- compinit
- # Completion caching
- zstyle ':completion::complete:*' use-cache on
- zstyle ':completion::complete:*' cache-path .zcache
- zstyle ':completion:*:cd:*' ignore-parents parent pwd
- #Completion Options
- zstyle ':completion:*:match:*' original only
- zstyle ':completion::prefix-1:*' completer _complete
- zstyle ':completion:predict:*' completer _complete
- zstyle ':completion:incremental:*' completer _complete _correct
- zstyle ':completion:*' completer _complete _prefix _correct _prefix _match _approximate
- # Path Expansion
- zstyle ':completion:*' expand 'yes'
- zstyle ':completion:*' squeeze-shlashes 'yes'
- zstyle ':completion::complete:*' '\\'
- zstyle ':completion:*:*:*:default' menu yes select
- zstyle ':completion:*:*:default' force-list always
- # GNU Colors /etc/DIR_COLORS
- LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=00;35:*.jpeg=00;35:*.gif=00;35:*.bmp=00;35:*.pbm=00;35:*.pgm=00;35:*.ppm=00;35:*.tga=00;35:*.xbm=00;35:*.xpm=00;35:*.tif=00;35:*.tiff=00;35:*.png=00;35:*.svg=00;35:*.svgz=00;35:*.mng=00;35:*.pcx=00;35:*.mov=00;35:*.mpg=00;35:*.mpeg=00;35:*.m2v=00;35:*.mkv=00;35:*.webm=00;35:*.ogm=00;35:*.mp4=00;35:*.m4v=00;35:*.mp4v=00;35:*.vob=00;35:*.qt=00;35:*.nuv=00;35:*.wmv=00;35:*.asf=00;35:*.rm=00;35:*.rmvb=00;35:*.flc=00;35:*.avi=00;35:*.fli=00;35:*.flv=00;35:*.gl=00;35:*.dl=00;35:*.xcf=00;35:*.xwd=00;35:*.yuv=00;35:*.cgm=00;35:*.emf=00;35:*.axv=00;35:*.anx=00;35:*.ogv=00;35:*.ogx=00;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:*.doc=00;33:*.docx=00;33:*.odt=00;33:*.pdf=00;33:*.html=00;33';
- export LS_COLORS
- [ -f /etc/DIR_COLORS ] && eval $(dircolors -b /etc/DIR_COLORS)
- export ZLSCOLORS="${LS_COLORS}"
- zmodload zsh/complist
- zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
- zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
- zstyle ':completion:*' completer _complete _match _approximate
- zstyle ':completion:*:match:*' original only
- zstyle ':completion:*:approximate:*' max-errors 1 numeric
- compdef pkill=kill
- compdef pkill=killall
- zstyle ':completion:*:*:kill:*' menu yes select
- zstyle ':completion:*:processes' command 'ps -au$USER'
- # Group matches and Describe
- zstyle ':completion:*:matches' group 'yes'
- zstyle ':completion:*:options' description 'yes'
- zstyle ':completion:*:options' auto-description '%d'
- zstyle ':completion:*:descriptions' format $'\e[01;33m -- %d --\e[0m'
- zstyle ':completion:*:messages' format $'\e[01;35m -- %d --\e[0m'
- zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found --\e[0m'
- # command alias
- alias ls='ls -aF --color=auto'
- alias ll='ls -alh'
- alias grep='grep --color=auto'
- alias ec='emacsclient -n -a emacs'
- alias rm='rm -v'
- alias acp='acp -vgi'
- alias amv='amv -vgi'
- alias cp='cp -v'
- alias mv='mv -v'
- alias aleq='alsamixer -D equal'
- alias sp='sudo pacman'
- alias sy='yaourt'
- alias suu='sudo yaourt -Syyua'
- alias snn='sudo nano'
- alias scc='sudo pacman -Scc && sudo pacman-optimize'
- alias avscan='clamscan -i --bytecode-unsigned=yes -r --detect-pua=yes'
- alias bdscan='/opt/BitDefender-scanner/bin/bdscan'
- alias yt='/home/cristi/Downloads/youtube-downloader'
- alias 7z_ppmd='7z a -t7z -m0=ppmd -mx=9 -mo=32 -mmem=1024m -ms=on'
- alias 7z_lzma='7z a -t7z -m0=lzma -mx=9 -mfb=273 -md=1024m -ms=on'
- alias 7z_lzma2='7z a -t7z -m0=lzma2 -mx=9 -mfb=273 -md=1024m -ms=on'
- alias -g '...'='../..'
- alias -g '....'='../../..'
- #alias -g BG='& exit'
- #alias -g C='|wc -l'
- #alias -g G='|grep'
- #alias -g H='|head'
- #alias -g Hl=' --help |& less -r'
- #alias -g K='|keep'
- #alias -g L='|less'
- #alias -g LL='|& less -r'
- #alias -g M='|most'
- #alias -g N='&>/dev/null'
- #alias -g R='| tr A-z N-za-m'
- #alias -g SL='| sort | less'
- #alias -g S='| sort'
- #alias -g T='|tail'
- #alias -g V='| vim -'
- function precmd {
- local TERMWIDTH
- (( TERMWIDTH = ${COLUMNS} - 1 ))
- ###
- # Truncate the path if it's too long.
- PR_FILLBAR=""
- PR_PWDLEN=""
- local promptsize=${#${(%):---(%n@%m:%d)----}}
- local pwdsize=${#${(%):-}}
- if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
- ((PR_PWDLEN=$TERMWIDTH - $promptsize))
- else
- PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $pwdsize)))..${PR_HBAR}.)}"
- fi
- ###
- # Get APM info.
- if which ibam > /dev/null; then
- PR_APM_RESULT=`ibam --percentbattery`
- elif which apm > /dev/null; then
- PR_APM_RESULT=`apm`
- fi
- }
- setopt extended_glob
- preexec () {
- if [[ "$TERM" == "screen" ]]; then
- local CMD=${1[(wr)^(*=*|sudo|-*)]}
- echo -n "\ek$CMD\e\\"
- fi
- }
- setprompt () {
- ###
- # Need this so the prompt will work.
- setopt prompt_subst
- ###
- # See if we can use colors.
- 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]%}"
- ###
- # See if we can use extended characters to look nicer.
- 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]:--}
- ###
- # Decide if we need to set titlebar text.
- case $TERM in
- xterm*)
- PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
- ;;
- screen)
- PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}'
- ;;
- *)
- PR_TITLEBAR=''
- ;;
- esac
- ###
- # Decide whether to set a screen title
- if [[ "$TERM" == "screen" ]]; then
- PR_STITLE=$'%{\ekzsh\e\\%}'
- else
- PR_STITLE=''
- fi
- ###
- # APM detection
- if which ibam > /dev/null; then
- PR_APM='$PR_RED${${PR_APM_RESULT[(f)1]}[(w)-2]}%%(${${PR_APM_RESULT[(f)3]}[(w)-1]})$PR_LIGHT_BLUE:'
- elif which apm > /dev/null; then
- PR_APM='$PR_RED${PR_APM_RESULT[(w)5,(w)6]/\% /%%}$PR_LIGHT_BLUE:'
- else
- PR_APM=''
- fi
- path=(
- #"$HOME/bin/$MACHTYPE-$OSTYPE"
- #"$HOME/bin"
- /usr/local/bin
- /usr/local/sbin
- /usr/local/etc
- /sbin
- /etc
- /bin
- /usr/bin
- /usr/sbin
- /usr/ucb
- /usr/bsd
- /usr/X11/bin
- /usr/bin/X11
- /usr/local/X11/bin
- /usr/monash/X11/bin
- /usr/monash/bin
- /usr/monash/etc
- /usr/monash/gnu/bin
- /usr/monash/contrib/bin
- /usr/monash/contrib/etc
- /usr/monash/contrib/X11/bin
- /usr/local/contrib/lib/kde/bin
- /usr/local/tex/bin
- /usr/local/lib/zsh/scr
- /usr/monash/contrib/games
- /usr/local/games
- /usr/monash/games
- /usr/games
- /opt
- /usr/lib/ccache/bin/
- "$path[@]"
- "$fpath[@]"
- )
- export PATH
- extract () {
- if [ -f $1 ] ; then
- case $1 in
- *.tar.bz2) tar xvjf $1 && cd $(basename "$1" .tar.bz2) ;;
- *.tar.gz) tar xvzf $1 && cd $(basename "$1" .tar.gz) ;;
- *.tar.xz) tar Jxvf $1 && cd $(basename "$1" .tar.xz) ;;
- *.tar) tar xvf $1 && cd $(basename "$1" .tar) ;;
- *.tbz2) tar xvjf $1 && cd $(basename "$1" .tbz2) ;;
- *.tgz) tar xvzf $1 && cd $(basename "$1" .tgz) ;;
- *.bz2) bunzip2 $1 && cd $(basename "$1" /bz2) ;;
- *.rar) unrar x $1 && cd $(basename "$1" .rar) ;;
- *.gz) gunzip $1 && cd $(basename "$1" .gz) ;;
- *.zip) unzip $1 && cd $(basename "$1" .zip) ;;
- *.Z) uncompress $1 && cd $(basename "$1" .Z) ;;
- *.7z) 7z x $1 && cd $(basename "$1" .7z) ;;
- *) echo "'$1' cannot be extracted via extract()" ;;
- esac
- else
- echo "'$1' is not a valid file!"
- fi
- }
- docx(){
- if [ -f $1 ] ; then
- unzip -p $1 word/document.xml | sed -e 's/<[^>]\{1,\}>//g; s/[^[:print:]]\{1,\}//g'
- else
- echo "'$1' is not a valid file!"
- fi
- }
- ###
- # Finally, the prompt.
- PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
- $PR_WHITE$PR_SHIFT_IN$PR_ULCORNER$PR_WHITE$PR_HBAR$PR_SHIFT_OUT%\[$PR_GREEN%(!.%SROOT%s.%n$PR_WHITE @ $PR_RED%M$PR_WHITE] - \
- %\[$PR_YELLOW%d)$PR_WHITE]
- $PR_WHITE$PR_SHIFT_IN$PR_LLCORNER$PR_WHITE$PR_HBAR$PR_SHIFT_OUT$PR_WHITE%\[$PR_BLUE%*$PR_WHITE]$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
- $PR_WHITE$PR_SHIFT_IN%\[$PR_BLUE>$PR_WHITE]$PR_SHIFT_OUT$PR_NO_COLOUR'
- #RPROMPT='$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_SHIFT_OUT
- #$PR_NO_COLOUR'
- #PS2='$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
- #$PR_BLUE$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\
- #$PR_LIGHT_GREEN%_$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
- #$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR'
- }
- setprompt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement