From e2d157d5895717e983e5cc4e5df792a6a5dbe0ac Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Sat, 30 Apr 2016 15:16:00 +0200 Subject: znt: update to v2.1.15 --- .../zsh-navigation-tools.plugin.zsh | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh') diff --git a/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh b/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh index 4aa3aa4b8..b26549152 100755 --- a/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh +++ b/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh @@ -15,13 +15,21 @@ if ! test -d "$CONFIG_DIR"; then mkdir "$CONFIG_DIR" fi +# 9 files set n-aliases.conf n-env.conf n-history.conf n-list.conf n-panelize.conf n-cd.conf n-functions.conf n-kill.conf n-options.conf -for i; do - if ! test -f "$CONFIG_DIR/$i"; then - cp "$REPO_DIR/.config/znt/$i" "$CONFIG_DIR" - fi -done +# Check for random 2 files if they exist +# This will shift 0 - 7 elements +shift $(( RANDOM % 8 )) +if ! test -f "$CONFIG_DIR/$1" || ! test -f "$CONFIG_DIR/$2"; then + # Something changed - examine every file + set n-aliases.conf n-env.conf n-history.conf n-list.conf n-panelize.conf n-cd.conf n-functions.conf n-kill.conf n-options.conf + for i; do + if ! test -f "$CONFIG_DIR/$i"; then + cp "$REPO_DIR/.config/znt/$i" "$CONFIG_DIR" + fi + done +fi # Don't leave positional parameters being set set -- @@ -30,12 +38,13 @@ set -- # Load functions # -autoload n-aliases n-cd n-env n-functions n-history n-kill n-list n-list-draw n-list-input n-options n-panelize +autoload n-aliases n-cd n-env n-functions n-history n-kill n-list n-list-draw n-list-input n-options n-panelize n-help autoload znt-usetty-wrapper znt-history-widget znt-cd-widget znt-kill-widget alias naliases=n-aliases ncd=n-cd nenv=n-env nfunctions=n-functions nhistory=n-history -alias nkill=n-kill noptions=n-options npanelize=n-panelize +alias nkill=n-kill noptions=n-options npanelize=n-panelize nhelp=n-help zle -N znt-history-widget bindkey '^R' znt-history-widget setopt AUTO_PUSHD HIST_IGNORE_DUPS PUSHD_IGNORE_DUPS +zstyle ':completion::complete:n-kill::bits' matcher 'r:|=** l:|=*' -- cgit v1.2.3-70-g09d2