Skip to content

Instantly share code, notes, and snippets.

@mattia
Created November 14, 2011 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattia/1363802 to your computer and use it in GitHub Desktop.
Save mattia/1363802 to your computer and use it in GitHub Desktop.
# Lines configured by zsh-newuser-install
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.history
HOSTNAME=`hostname`
bindkey -v
PAGER='less'
EDITOR='vim'
TERM=xterm-256color
# End of lines configured by zsh-newuser-install
#
# Set the percent for prompt
setopt prompt_percent
# The following lines were added by compinstall
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# miglioramenti dello stile del completamento
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
# # autocorrezione
setopt correctall
#history
setopt bang_hist
setopt share_history
# # prompt
autoload -U promptinit
promptinit
setopt prompt_subst
autoload -U colors
colors
#PROMPT='%{${fg_bold[blue]}%}%n%{$reset_color%}%{$fg_bold[black]%}@%{$fg[green]%}%m%{$fg_bold[black]%}:%{$fg[green]%}%~%{$reset_color%}%{${fg_bold[yellow]}%}%#%{$reset_color%}'
PROMPT='%{$fg_bold[black]%}%{$fg[green]%}%~%{$reset_color%}%{${fg_bold[yellow]}%} %# %{$reset_color%}'
RPROMPT='%{${fg_bold[blue]}%}%n%{$reset_color%}%{$fg_bold[black]%}@%U%{$fg[green]%}%m%{$fg_bold[black]%}%u->%t%b%E'
#prompt walters
# tab completion for PID :D
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
# impostare la cronologia per prevenire la memorizzazione delle voci duplicate
setopt hist_ignore_all_dups
# globbing esteso
setopt extendedglob
#alias for ls colored output
#alias ls='ls --color=auto -F'
alias ls='ls -GF'
#alias for rake errors with octopress
# alias rake='noglob rake'
#carico .zprofile
source ~/.zprofile
#set up tasti
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
for k in ${(k)key} ; do
#$terminfo[] entries are weird in ncurses application mode...
[[ ${key[$k]} == $'\eO'* ]] && key[$k]=${key[$k]/O/[}
done
unset k
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "[5~" beginning-of-line #"${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "[6~" end-of-line #"${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment