From: Simon Ruderich Date: Sat, 6 Aug 2011 12:39:54 +0000 (+0200) Subject: zsh/rc: Multiple documentation fixes/updates. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=ad68cb379b02f177c84e15f6b1eb85a8d3392562;p=config%2Fdotfiles.git zsh/rc: Multiple documentation fixes/updates. --- diff --git a/zsh/rc b/zsh/rc index 7c833b5..37ca7a1 100644 --- a/zsh/rc +++ b/zsh/rc @@ -96,7 +96,7 @@ fi # Autoload add-zsh-hook to add/remove zsh hook functions easily. autoload -Uz add-zsh-hook -# Load zmv (zsh move) which is powerful to rename files. +# Load zmv (zsh move) which is a powerful file renamer. autoload -Uz zmv @@ -114,10 +114,10 @@ setopt incappendhistory setopt histignoredups # Vim like completions of previous executed commands (also enter Vi-mode). If # called at the beginning it just recalls old commands (like cursor up), if -# called after typing something, only lines starting with the typed are -# returned. Very useful to get old commands quickly. Thanks to Mikachu in #zsh -# on Freenode (2010-01-17 12:47 CET) for the information how to a use function -# with bindkey. +# called after typing something, only lines starting with the typed text are +# returned. Very useful to get old commands quickly - in addition to the +# history commands (!..). Thanks to Mikachu in #zsh on Freenode (2010-01-17 +# 12:47 CET) for the information how to a use function with bindkey. zle -N my-vi-history-beginning-search-backward my-vi-history-beginning-search-backward() { local not_at_beginning_of_line @@ -150,7 +150,7 @@ autoload -Uz colors && colors zmodload zsh/datetime # Some shortcuts for colors. The %{...%} tells zsh that the data in between -# doesn't need any space, necessary for correct prompt draw. +# doesn't need any space, necessary for correct prompt drawing. local red="%{${fg[red]}%}" local blue="%{${fg[blue]}%}" local green="%{${fg[green]}%}" @@ -203,7 +203,7 @@ if [[ $ZSH_VERSION == (4.3.<9->|4.<4->*|<5->*) || zstyle ':vcs_info:*' unstagedstr '¹' zstyle ':vcs_info:*' stagedstr '²' - # Default to running vcs_info. If possible we prevent running it later for + # Default to run vcs_info. If possible we prevent running it later for # speed reasons. If set to a non empty value vcs_info is run. FORCE_RUN_VCS_INFO=1 @@ -249,16 +249,15 @@ else fi # Set the prompt. A two line prompt is used. On the top left the current -# working directory is displayed, on the right vcs_info (if available). On the -# bottom left current user name and host is shown, the exit code of the last -# command if it wasn't 0, the number of running jobs if not 0. +# working directory is displayed, on the right vcs_info (if available) and the +# current time in hex. On the bottom left current user name and host is shown, +# the exit code of the last command if it wasn't 0, the number of running jobs +# if not 0. # # The prompt is in green and blue to make easily detectable, the error exit # code in red and bold and the job count in yellow. # # Thanks to Adam's prompt for the basic idea of this prompt. -# -# The current time is display in hex in the right prompt. prompt_precmd() { # Regex to remove elements which take no space. Used to calculate the # width of the top prompt. Thanks to Bart's and Adam's prompt code in @@ -445,8 +444,8 @@ fi # COMPLETION SETTINGS -# Load the complist module which provides additions to completion lists -# (coloring, scrollable). +# Load the complist module which provides additional features to completion +# lists (coloring, scrolling). zmodload zsh/complist # Use new completion system, store dumpfile in ~/.zsh/cache to prevent # cluttering of ~/. $fpath must be set before calling this. Thanks to Adlai in @@ -454,15 +453,16 @@ zmodload zsh/complist # problem. autoload -Uz compinit && compinit -d ~/.zsh/cache/zcompdump -# Use cache to speed up completions. +# Use cache to speed up some slow completions (dpkg, perl modules, etc.). zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache # Complete arguments and fix spelling mistakes when possible. zstyle ':completion:*' completer _complete _match _correct _approximate -# Make sure the list of possible completions is displayed after pressing -# the first time. +# If there are multiple matches after pressing always display them +# immediately without requiring another . a lists aaa, aab, aac as +# possible completions if the directory contains aaa, aab, aac, bbb. setopt nolistambiguous # Allow completions in the middle of a text, i.e. "/usr/bin/whatever" # completes like "/usr/bin/". Useful when adding new options to commands. @@ -471,14 +471,13 @@ bindkey '^I' expand-or-complete-prefix # typing in lowercase most of the time and completion fixes the case. zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' -# Use ls like colors for completions. +# Use ls-like colors for completions. zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} # Make completion lists scrollable so "do you wish to see all n possibilities" -# is no longer displayed. +# is no longer displayed. Display current position in percent (%p). zstyle ':completion:*' list-prompt '%p' -# Display group name (like 'external command', 'alias', etc.) when there are -# multiple matches in bold. +# Display group name (%d) (like 'external command', 'alias', etc.), in bold. zstyle ':completion:*' format ' %B%d%b:' # Display different types of matches separately. zstyle ':completion:*' group-name '' @@ -504,7 +503,7 @@ zstyle ':completion:*:(mv|cp):*' ignore-line no zstyle ':completion:*:*:-command-:*' ignored-patterns './config.*' # Don't complete unwanted files with Vim. Thanks to Nomexous in #zsh on -# Freenode (2010-06-06 04:54 CEST). See below to complete them. +# Freenode (2010-06-06 04:54 CEST). See below for a way to complete them. zstyle ':completion:*:*:vim:*:all-files' ignored-patterns '*.aux' '*.log' \ '*.pdf' '*.class'