]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: Handle fg when naming windows.
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index 236374b737ade57f984da916567ccf905332398b..37befb765de53f99c8213f49513b5f9c8047f41d 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -112,6 +112,8 @@ setopt appendhistory
 setopt incappendhistory
 # If the same command is run multiple times store it only once in the history.
 setopt histignoredups
+# Don't add lines starting with a space to the history.
+setopt histignorespace
 # 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 text are
@@ -184,7 +186,7 @@ if [[ $ZSH_VERSION == (4.3.<9->|4.<4->*|<5->*) ||
     zstyle ':vcs_info:*' enable git hg
     # Check the repository for changes so they can be used in %u/%c (see
     # below). This comes with a speed penalty for bigger repositories.
-    zstyle ':vcs_info:*' check-for-changes true
+    zstyle ':vcs_info:*' check-for-changes yes
 
     # Set style of vcs_info display. The current branch (green) and VCS (blue)
     # is displayed. If there is an special action going on (merge, rebase)
@@ -315,7 +317,8 @@ add-zsh-hook precmd prompt_precmd
 # currently running program.
 #
 # When a program is started preexec() sets the window's name to it; when it
-# stops precmd() resets the window's name to 'zsh'.
+# stops precmd() resets the window's name to 'zsh'. 'fg' is supported and sets
+# the window's name to the resumed job.
 #
 # It works with screen, xterm and rxvt.
 #
@@ -348,6 +351,14 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
             program_name=${program_name#sudo }
             program_sudo=yes
         fi
+
+        # Replace fg with the resumed job name.
+        if [[ $program_name == fg ]]; then
+            program_name=${jobtexts[%+]}
+        elif [[ $program_name == fg* ]]; then
+            program_name=${jobtexts[${program_name#fg }]}
+        fi
+
         # Remove all arguments from the program name.
         program_name=${program_name%% *}
 
@@ -463,7 +474,7 @@ zmodload zsh/complist
 autoload -Uz compinit && compinit -d ~/.zsh/cache/zcompdump
 
 # Use cache to speed up some slow completions (dpkg, perl modules, etc.).
-zstyle ':completion:*' use-cache on
+zstyle ':completion:*' use-cache yes
 zstyle ':completion:*' cache-path ~/.zsh/cache
 
 # Let the completion system handle all completions, including expanding of