Skip to content

Instantly share code, notes, and snippets.

@gertrudster
Created November 9, 2011 15:38
Show Gist options
  • Save gertrudster/1351814 to your computer and use it in GitHub Desktop.
Save gertrudster/1351814 to your computer and use it in GitHub Desktop.
.zshrc
# users generic .zshrc file for zsh(1)
autoload colors
colors
autoload -U compinit
compinit
export LSCOLORS=ExFxCxdxBxxxxxBxBxExEx
export LS_COLORS='di=01;34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
zstyle ':completion:*' list-colors 'di=01;34' 'ln=35' 'so=32' 'ex=31' 'bd=46;34' 'cd=43;34' 'su=41;30' 'sg=46;30' 'tw=42;30' 'ow=43;30' menu select=1
zstyle ':completion:*:default' menu select=1
PROMPT="%{${fg[red]}%}%(4~,%-1~/.../%2~,%~)%%%{${reset_color}%} "
PROMPT2="%{${fg[red]}%}%_%%%{${reset_color}%} "
SPROMPT="%{${fg[red]}%}%r is correct? [n,y,a,e]:%{${reset_color}%} "
[ -n "${REMOTEHOST}${SSH_CONNECTION}" ] &&
PROMPT="%{${fg[yellow]}%}${HOST%%.*} ${PROMPT}"
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
autoload add-zsh-hook
add-zsh-hook chpwd update_terminal_cwd
update_terminal_cwd
setopt auto_cd
setopt auto_list
setopt auto_menu
setopt auto_param_keys
setopt auto_param_slash
setopt auto_pushd
setopt complete_aliases
setopt correct
setopt equals
setopt extended_glob
setopt hist_ignore_all_dups hist_save_nodups
setopt list_packed
setopt list_types
setopt mark_dirs
setopt magic_equal_subst
setopt no_flow_control
setopt no_hup
setopt noautoremoveslash
setopt nolistbeep
setopt prompt_subst
setopt auto_remove_slash
setopt share_history
bindkey -e
bindkey "^q" push-line
autoload history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^p" history-beginning-search-backward-end
bindkey "^n" history-beginning-search-forward-end
bindkey "\\ep" history-beginning-search-backward-end
bindkey "\\en" history-beginning-search-forward-end
HISTFILE=~/.zsh_history
HISTSIZE=1000000
SAVEHIST=1000000
[ -f ~/.zshrc_aliases ] && source ~/.zshrc_aliases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment