# Enable incremental search which is especially useful when the string is an
# argument and not the command.
# Enable incremental search which is especially useful when the string is an
# argument and not the command.
# Also enable my usual use of Ctrl-P/Ctrl-N to get the previous/next matching
# history entry.
if [[ $ZSH_VERSION == (4.<4->*|<5->*) ]]; then
# Also enable my usual use of Ctrl-P/Ctrl-N to get the previous/next matching
# history entry.
if [[ $ZSH_VERSION == (4.<4->*|<5->*) ]]; then
- bindkey -M isearch '^P' history-incremental-search-backward
- bindkey -M isearch '^N' history-incremental-search-forward
+ bindkey -M isearch '^P' history-incremental-pattern-search-backward
+ bindkey -M isearch '^N' history-incremental-pattern-search-forward
-# doesn't need any space, necessary for correct prompt drawing.
+# doesn't need any space, necessary for correct prompt drawing. Use %F{color}
+# in more recent zsh versions (here compatibility is important).
local red="%{${fg[red]}%}"
local blue="%{${fg[blue]}%}"
local green="%{${fg[green]}%}"
local red="%{${fg[red]}%}"
local blue="%{${fg[blue]}%}"
local green="%{${fg[green]}%}"
# Don't track the time for certain (possible) long running processes which
# need no automatic notification.
for ignore in elinks man mutt vim; do
# Don't track the time for certain (possible) long running processes which
# need no automatic notification.
for ignore in elinks man mutt vim; do
# Don't complete unwanted files with Vim. Thanks to Nomexous in #zsh on
# Freenode (2010-06-06 04:54 CEST). See below for a way to complete them.
zstyle ':completion:*:*:vim:*:all-files' ignored-patterns \
# Don't complete unwanted files with Vim. Thanks to Nomexous in #zsh on
# Freenode (2010-06-06 04:54 CEST). See below for a way to complete them.
zstyle ':completion:*:*:vim:*:all-files' ignored-patterns \
# If not already in screen or tmux, reattach to a running session or create a
# new one. This also starts screen/tmux on a remote server when connecting
# through ssh.
# If not already in screen or tmux, reattach to a running session or create a
# new one. This also starts screen/tmux on a remote server when connecting
# through ssh.
# Get running detached sessions.
if [[ $zshrc_use_multiplexer = screen ]]; then
session=$(screen -list | grep 'Detached' | awk '{ print $1; exit }')
# Get running detached sessions.
if [[ $zshrc_use_multiplexer = screen ]]; then
session=$(screen -list | grep 'Detached' | awk '{ print $1; exit }')