Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/zsh
- # Orgasmic Zshell configuration file made by
- # Quel Gran Figo Di Tancredi Orlando.
- # Code provided under the WTFPL (→ http://sam.zoy.org/wtfpl/)
- # © 2011 Quel Gran Figo Di Tancredi Orlando.
- # Always in development: please don't break my ballz.
- # Settings
- # ========
- # Colors variables
- # ----------------
- grey="%{$(echo -n '\e[1;30m')%}"
- red="%{$(echo -n '\e[1;31m')%}"
- green="%{$(echo -n '\e[1;32m')%}"
- yellow="%{$(echo -n '\e[1;33m')%}"
- blue="%{$(echo -n '\e[1;34m')%}"
- magenta="%{$(echo -n '\e[1;35m')%}"
- cyan="%{$(echo -n '\e[1;36m')%}"
- white="%{$(echo -n '\e[1;37m')%}"
- lightred="%{$(echo -n '\e[0;31m')%}"
- lightgreen="%{$(echo -n '\e[0;32m')%}"
- lightyellow="%{$(echo -n '\e[0;33m')%}"
- lightblue="%{$(echo -n '\e[0;34m')%}"
- lightmagenta="%{$(echo -n '\e[0;34m')%}"
- lightcyan="%{$(echo -n '\e[0;35m')%}"
- lightwhite="%{$(echo -n '\e[0;37m')%}"n/zsh
- # Autocompletion
- # --------------
- autoload -U compinit
- compinit
- zstyle ':completion:*' completer _complete _ignored _match _approximate
- zstyle ':completion:*' format 'Completing %d'
- zstyle ':completion:*' group-name ''
- zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
- zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=*'
- zstyle ':completion:*' use-cache on
- zstyle ':completion:*' cache-path $HOME/.zsh/cache
- zstyle ':completion:*:match:*' original only
- zstyle ':completion:*:approximate:*' max-errors 1 numeric
- zstyle ':completion:*:functions' ignored-patterns '_*'
- # Autocorrect
- # -----------
- setopt correct
- # Prompt
- # ------
- autoload -U promptinit
- promptinit
- PS1=$'%n@%m:%~%# '
- # Keybinding
- # ----------
- bindkey -e
- bindkey "\eOH" beginning-of-line
- bindkey "\eOF" end-of-line
- bindkey "\e[2~" overwrite-mode
- bindkey "\e[3~" delete-char
- bindkey "^[[A" up-line-or-history
- bindkey "^[[B" down-line-or-history
- bindkey "\e\e[C" backward-char
- bindkey "\e\e[D" forward-char
- bindkey "\e[5~" beginning-of-history
- bindkey "\e[6~" end-of-history
- # History
- # -------
- HISTFILE=~/.history
- HISTSIZE=1000
- SAVEHIST=1000
- # Enviroment variables
- # --------------------
- export EDITOR="/usr/bin/vim"
- export BROWSER="/usr/bin/google-chrome"
- export TERMINAL="/usr/bin/urxvt"
- # Aliases
- # =======
- # Coloured output for grep and ls
- # -------------------------------
- alias ls='ls --color=auto'
- alias grep='grep --color=auto'
- # Right way to run some programs
- # ------------------------------
- alias irssi='screen irssi'
- alias weechat='weechat-curses'
- alias scrota='scrot -c -d 10 ~/Images/Screenshots/Screenshot\ %d-%m-%Y\ %H\:%M.png'
- # VI-style commands
- # -----------------
- alias :q='exit'
- # Functions
- # =========
- # Compress
- # --------
- compress () { # compress archive.tar folder
- if [ -d $2 ] ; then
- case $1 in
- *.tar.bz2) tar vcjf $1 $2;;
- *.tar.gz) tar vczf $1 $2;;
- *.bz2) bunzip2 $1 $2;;
- *.gz) gzip $1 $2;;
- *.tar) tar vcf $1 $2;;
- *.tbz2) tar vcjf $1 $2;;
- *.tgz) tar vczf $1 $2;;
- *.zip) zip -r $1 $2;;
- *.Z) compress $1 $2;;
- *.7z) 7z a -t7z $1 $2;;
- *) echo "Non riesco a comprimere $2.";;
- esac
- else
- echo "$2 non è un archivio valido."
- fi
- }
- # Extract
- # -------
- extract () { # extract archive.tar
- if [ -f $1 ] ; then
- case $1 in
- *.ar.bz2) tar vxjf $1;;
- *.ar.gz) tar vxzf $1;;
- *.bz2) bunzip2 $1;;
- *.rar) unrar x $1;;
- *.gz) gunzip $1;;
- *.tar) tar vxf $1;;
- *.tbz2) tar vxjf $1;;
- *.tgz) tar vxzf $1;;
- *.zip) unzip $1;;
- *.Z) uncompress $1;;
- *.7z) 7z x $1;;
- *) echo "Non riesco a estrarre $1.";;
- esac
- else
- echo "$1 non è un archivio valido."
- fi
- }
- # Open config files
- # -----------------
- config () {
- case $1 in
- rc) $EDITOR /etc/rc.conf;;
- vim) $EDITOR ~/.vimrc;;
- zsh) $EDITOR ~/.zshrc;;
- xorg) $EDITOR /etc/X11/xorg.conf;;
- fstab) $EDITOR /etc/fstab;;
- tint2) $EDITOR ~/.config/tint2/tint2rc;;
- xdefs) $EDITOR ~/.Xdefaults;;
- xinit) $EDITOR ~/.xinitrc;;
- pacman) $EDITOR /etc/pacman.conf;;
- inittab) $EDITOR /etc/inittab;;
- mplayer) $EDITOR ~/.mplayer/config;;
- *) if [ -f "$1" ]; then
- if [ -w "$1" ]; then
- $EDITOR "$1"
- else
- $EDITOR "$1"
- fi
- else
- echo "Invalid option."
- fi;;
- esac
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement