068feca15d09dce6747d0fb6cab2027b938e82bd

Author
Philipp Schmitt <pschmitt@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(zsh-navigation-tools)!: update to zdharma-continuum fork (#10402)

BREAKING CHANGE: the `zsh-navigation-tools` plugin now bundles the version from the
zdharma-continuum project, which republished the projects that psprint deleted (we
don't yet know yet why). In theory this change doesn't break anything, but be aware
of the change and that the upstream repository now lives somewhere else.

Source: https://github.com/zdharma-continuum/zsh-navigation-tools/commit/67b24e1

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/zsh-navigation-tools/.config/znt/README.txt b/plugins/zsh-navigation-tools/.config/znt/README.txt
  2deleted file mode 100644
  3index c3d6c821a4d3ce187da67b942c0fc8ae91963f80..0000000000000000000000000000000000000000
  4--- a/plugins/zsh-navigation-tools/.config/znt/README.txt
  5+++ /dev/null
  6@@ -1 +0,0 @@
  7-These are skeletons, configuration is read from ~/.config/znt/*
  8diff --git a/plugins/zsh-navigation-tools/README.md b/plugins/zsh-navigation-tools/README.md
  9index 7d2ce99f4e4a069704b6462926aed6ea5de78d6f..9fd2d541494107079713e38b26df9fda6b68a6fb 100644
 10--- a/plugins/zsh-navigation-tools/README.md
 11+++ b/plugins/zsh-navigation-tools/README.md
 12@@ -1,15 +1,14 @@
 13 [![License (GPL version 3)](https://img.shields.io/badge/license-GNU%20GPL%20version%203-blue.svg?style=flat-square)](./LICENSE)
 14 [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](./LICENSE)
 15 ![ZSH 5.0.0](https://img.shields.io/badge/zsh-v5.0.0-orange.svg?style=flat-square)
 16+[![Gitter][gitter-image]][gitter-link]
 17 
 18 ![znt logo](http://imageshack.com/a/img905/2629/WK9qjN.png)
 19 
 20-[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D6XDCHDSBDSDG)
 21-
 22 # Zsh Navigation Tools
 23 
 24-Also check out [![ZCA](http://imageshack.com/a/img911/8084/qSpO8a.png) Zsh Command Architect](https://github.com/psprint/zsh-cmd-architect)
 25-and [Zconvey](https://github.com/psprint/zconvey)
 26+Also check out [![ZCA](http://imageshack.com/a/img911/8084/qSpO8a.png) Zsh Command Architect](https://github.com/zdharma-continuum/zsh-cmd-architect)
 27+and [Zconvey](https://github.com/zdharma-continuum/zconvey)
 28 
 29 
 30 
 31@@ -107,10 +106,10 @@ history management and various integrations with `Zsh`.
 32 
 33 * 30-04-2016
 34   - New feature: color themes. Use `Ctrl-T` and `Ctrl-G` to browse predefined
 35-    themes. They are listed in [~/.config/znt/n-list.conf](https://github.com/psprint/zsh-navigation-tools/blob/master/.config/znt/n-list.conf).
 36+    themes. They are listed in [~/.config/znt/n-list.conf](https://github.com/zdharma-continuum/zsh-navigation-tools/blob/master/.config/znt/n-list.conf).
 37     Use the file to permanently set a color scheme. Also, I sent a patch to Zsh developers
 38     and starting from Zsh > 5.2 (not yet released) supported will be 256 colors.
 39-    The file [~/.config/znt/n-list.conf](https://github.com/psprint/zsh-navigation-tools/blob/master/.config/znt/n-list.conf)
 40+    The file [~/.config/znt/n-list.conf](https://github.com/zdharma-continuum/zsh-navigation-tools/blob/master/.config/znt/n-list.conf)
 41     already has set of 256-color themes prepared :)
 42 
 43     ![themes](http://imageshack.com/a/img924/4310/EbRh30.gif)
 44@@ -130,7 +129,7 @@ history management and various integrations with `Zsh`.
 45 ## Installation
 46 
 47 ```
 48-sh -c "$(curl -fsSL https://raw.githubusercontent.com/psprint/zsh-navigation-tools/master/doc/install.sh)"
 49+sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma-continuum/zsh-navigation-tools/master/doc/install.sh)"
 50 ```
 51 
 52 To update run the command again.
 53@@ -140,16 +139,16 @@ will be updated with only `8` lines of code, which will be added at the bottom.
 54 
 55 After installing and reloading shell give `ZNT` a quick try with `Ctrl-R` – this keyboard shortcut will open `n-history`.
 56 
 57-## Installation With [Zplugin](https://github.com/psprint/zplugin)
 58-Add `zplugin load psprint/zsh-navigation-tools` to `.zshrc`. The config files will be in `~/.config/znt`.
 59+## Installation With [Zinit](https://github.com/zdharma-continuum/zinit)
 60+Add `zinit load zdharma-continuum/zsh-navigation-tools` to `.zshrc`. The config files will be in `~/.config/znt`.
 61 
 62-## Installation With Zgen
 63+## Installation With Zgenom/Zgen
 64 
 65-Add `zgen load psprint/zsh-navigation-tools` to `.zshrc` and issue a `zgen reset` (this assumes that there is a proper `zgen save` construct in `.zshrc`).
 66+Add `zgen load zdharma-continuum/zsh-navigation-tools` to `.zshrc` and issue a `zgen reset` (this assumes that there is a proper `zgen save` construct in `.zshrc`).
 67 The config files will be available in `~/.config/znt`.
 68 
 69 ## Installation With Antigen
 70-Add `antigen bundle psprint/zsh-navigation-tools` to `.zshrc`. There also
 71+Add `antigen bundle zdharma-continuum/zsh-navigation-tools` to `.zshrc`. There also
 72 should be `antigen apply`. The config files will be in `~/.config/znt`.
 73 
 74 ## Single File Manual Installation
 75@@ -194,7 +193,7 @@ alias naliases=n-aliases ncd=n-cd nenv=n-env nfunctions=n-functions nhistory=n-h
 76 alias nkill=n-kill noptions=n-options npanelize=n-panelize nhelp=n-help
 77 ```
 78 
 79-Don't forget to copy [configuration files](https://github.com/psprint/zsh-navigation-tools/tree/master/.config/znt). They should go to `~/.config/znt`. Moreover, `n-cd` works together with option `AUTO_PUSHD` and you should have:
 80+Don't forget to copy [configuration files](https://github.com/zdharma-continuum/zsh-navigation-tools/tree/master/.config/znt). They should go to `~/.config/znt`. Moreover, `n-cd` works together with option `AUTO_PUSHD` and you should have:
 81 
 82 ```zsh
 83 setopt AUTO_PUSHD
 84@@ -397,15 +396,7 @@ The same with doing any non-typical Zsh Navigation Tools installation.
 85 
 86 ## More
 87 
 88-- be aware of [this](https://github.com/psprint/zsh-navigation-tools/blob/f49f910d239ae5bc6e1a5bb34930307b4f4e3ffe/zsh-navigation-tools.plugin.zsh#L35-L49)
 89-
 90-## IRC Channel
 91-
 92-Channel `#zplugin@freenode` is a support place for all author's projects. Connect to:
 93-[chat.freenode.net:6697](ircs://chat.freenode.net:6697/%23zplugin) (SSL) or [chat.freenode.net:6667](irc://chat.freenode.net:6667/%23zplugin)
 94- and join #zplugin.
 95-
 96-Following is a quick access via Webchat [![IRC](https://kiwiirc.com/buttons/chat.freenode.net/zplugin.png)](https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin)
 97+- be aware of [this](https://github.com/zdharma-continuum/zsh-navigation-tools/blob/f49f910d239ae5bc6e1a5bb34930307b4f4e3ffe/zsh-navigation-tools.plugin.zsh#L35-L49)
 98 
 99 # Fixing tmux, screen and linux vt
100 
101@@ -429,3 +420,5 @@ It will not display underline properly, but will instead highlight by a color,
102 which is quite nice. The same will not work for FreeBSD's vt, `ZNT` will detect
103 if that vt is used and will revert to highlighting elements via `reverse` mode.
104 
105+[gitter-image]: https://badges.gitter.im/zdharma-continuum/community.svg
106+[gitter-link]: https://gitter.im/zdharma-continuum/community
107diff --git a/plugins/zsh-navigation-tools/doc/generate_single_file b/plugins/zsh-navigation-tools/doc/generate_single_file
108new file mode 100755
109index 0000000000000000000000000000000000000000..d3d39383412621ee789cd9b139b17ba3d8f00a5b
110--- /dev/null
111+++ b/plugins/zsh-navigation-tools/doc/generate_single_file
112@@ -0,0 +1,35 @@
113+#!/bin/zsh
114+
115+local PLUGIN_FILE="doc/zshnavigationtools.plugin.zsh"
116+
117+[ -d doc ] || cd ..
118+
119+rm -vf "$PLUGIN_FILE"
120+echo "# The preamble comments apply when using ZNT as autoload functions" >>"$PLUGIN_FILE"
121+echo "# https://github.com/psprint/zsh-navigation-tools" >>"$PLUGIN_FILE"
122+echo "# License is GPLv3 and MIT" >>"$PLUGIN_FILE"
123+echo -n "# " >>"$PLUGIN_FILE"
124+git show-ref master | head -1 >>"$PLUGIN_FILE"
125+echo >>"$PLUGIN_FILE"
126+
127+for i in n-*(on); do
128+    echo "$i() {" >>"$PLUGIN_FILE"
129+    cat "$i" >>"$PLUGIN_FILE"
130+    echo "}" >>"$PLUGIN_FILE"
131+    echo "alias n${i#n-}=$i" >>"$PLUGIN_FILE"
132+    echo >>"$PLUGIN_FILE"
133+done
134+
135+# Append znt-* files
136+for i in znt-*(on); do
137+    echo "$i() {" >>"$PLUGIN_FILE"
138+    cat "$i" >>"$PLUGIN_FILE"
139+    echo "}" >>"$PLUGIN_FILE"
140+    echo >>"$PLUGIN_FILE"
141+done
142+
143+# Append ^R bind
144+echo "zle -N znt-history-widget" >>"$PLUGIN_FILE"
145+echo "bindkey '^R' znt-history-widget" >>"$PLUGIN_FILE"
146+echo "setopt AUTO_PUSHD HIST_IGNORE_DUPS PUSHD_IGNORE_DUPS" >>"$PLUGIN_FILE"
147+
148diff --git a/plugins/zsh-navigation-tools/doc/img/n-history2.png b/plugins/zsh-navigation-tools/doc/img/n-history2.png
149new file mode 100644
150index 0000000000000000000000000000000000000000..fa23de00d5c6b4550c96fe783d34575d8fdecbfe
151Binary files /dev/null and b/plugins/zsh-navigation-tools/doc/img/n-history2.png differ
152diff --git a/plugins/zsh-navigation-tools/doc/install.sh b/plugins/zsh-navigation-tools/doc/install.sh
153new file mode 100755
154index 0000000000000000000000000000000000000000..2b71aa3b411a515cdad4be3666611fb1538d5e57
155--- /dev/null
156+++ b/plugins/zsh-navigation-tools/doc/install.sh
157@@ -0,0 +1,70 @@
158+#!/bin/sh
159+
160+if ! type git 2>/dev/null 1>&2; then
161+    echo "Please install GIT first"
162+    echo "Exiting"
163+    exit 1
164+fi
165+
166+#
167+# Clone or pull
168+#
169+
170+if ! test -d "$HOME/.config"; then
171+    mkdir "$HOME/.config"
172+fi
173+
174+if ! test -d "$HOME/.config/znt"; then
175+    mkdir "$HOME/.config/znt"
176+fi
177+
178+echo ">>> Downloading zsh-navigation-tools to ~/.config/znt"
179+if test -d ~/.config/znt/zsh-navigation-tools; then
180+    cd ~/.config/znt/zsh-navigation-tools
181+    git pull origin master
182+else
183+    cd ~/.config/znt
184+    git clone https://github.com/psprint/zsh-navigation-tools.git zsh-navigation-tools
185+fi
186+echo ">>> Done"
187+
188+#
189+# Copy configs
190+#
191+
192+echo ">>> Copying config files"
193+
194+cd ~/.config/znt
195+
196+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
197+
198+for i; do
199+    if ! test -f "$i"; then
200+        cp -v zsh-navigation-tools/.config/znt/$i .
201+    fi
202+done
203+
204+echo ">>> Done"
205+
206+#
207+# Modify .zshrc
208+#
209+
210+echo ">>> Updating .zshrc"
211+if ! grep zsh-navigation-tools ~/.zshrc >/dev/null 2>&1; then
212+    echo >> ~/.zshrc
213+    echo "### ZNT's installer added snippet ###" >> ~/.zshrc
214+    echo "fpath=( \"\$fpath[@]\" \"\$HOME/.config/znt/zsh-navigation-tools\" )" >> ~/.zshrc
215+    echo "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" >> ~/.zshrc
216+    echo "autoload znt-usetty-wrapper znt-history-widget znt-cd-widget znt-kill-widget" >> ~/.zshrc
217+    echo "alias naliases=n-aliases ncd=n-cd nenv=n-env nfunctions=n-functions nhistory=n-history" >> ~/.zshrc
218+    echo "alias nkill=n-kill noptions=n-options npanelize=n-panelize nhelp=n-help" >> ~/.zshrc
219+    echo "zle -N znt-history-widget" >> ~/.zshrc
220+    echo "bindkey '^R' znt-history-widget" >> ~/.zshrc
221+    echo "setopt AUTO_PUSHD HIST_IGNORE_DUPS PUSHD_IGNORE_DUPS" >> ~/.zshrc
222+    echo "zstyle ':completion::complete:n-kill::bits' matcher 'r:|=** l:|=*'" >> ~/.zshrc
223+    echo "### END ###" >> ~/.zshrc
224+    echo ">>> Done"
225+else
226+    echo ">>> .zshrc already updated, not making changes"
227+fi
228diff --git a/plugins/zsh-navigation-tools/doc/n-preview b/plugins/zsh-navigation-tools/doc/n-preview
229new file mode 100644
230index 0000000000000000000000000000000000000000..2d8eea3fb59516d24d6d54c2a6b4a8e5d201c792
231--- /dev/null
232+++ b/plugins/zsh-navigation-tools/doc/n-preview
233@@ -0,0 +1,224 @@
234+# Copy this file into /usr/share/zsh/site-functions/
235+# and add 'autoload n-preview` to .zshrc
236+#
237+# This is partially a test if n-list-draw and n-list-input can be
238+# used multiple times to create multiple lists. It might become
239+# more usable if someone adds more features like previewing of
240+# archive contents.
241+
242+emulate -L zsh
243+
244+zmodload zsh/curses
245+
246+setopt typesetsilent extendedglob
247+trap "return" TERM INT QUIT
248+trap "_vpreview_exit" EXIT
249+
250+local IFS="
251+"
252+
253+[ -f ~/.config/znt/n-list.conf ] && . ~/.config/znt/n-list.conf
254+
255+[[ "$colorpair" = "" ]] && colorpair="white/black"
256+local background="${colorpair#*/}"
257+
258+# Drawing and input
259+autoload n-list-draw n-list-input
260+
261+# Cleanup before any exit
262+_vpreview_exit() {
263+    zcurses 2>/dev/null delwin files
264+    zcurses 2>/dev/null delwin body 
265+    zcurses 2>/dev/null delwin status
266+    zcurses 2>/dev/null refresh
267+    zcurses end
268+}
269+
270+# Outputs a message in the bottom of the screen
271+_vpreview_status_msg() {
272+    zcurses move status 1 2
273+    zcurses clear status eol
274+    zcurses string status "$1"
275+}
276+
277+# Prefer tput, then module terminfo
278+_nlist_cursor_visibility() {
279+    if type tput 2>/dev/null 1>&2; then
280+        [ "$1" = "1" ] && tput cvvis
281+        [ "$1" = "0" ] && tput civis
282+    elif [ "$has_termcap" = "1" ]; then
283+        [ "$1" = "1" ] && [ -n $terminfo[cvvis] ] && echo -n $terminfo[cvvis]
284+        [ "$1" = "0" ] && [ -n $terminfo[civis] ] && echo -n $terminfo[civis]
285+    fi 
286+}
287+
288+#
289+# Main code
290+#
291+
292+integer term_height="$LINES"
293+integer term_width="$COLUMNS"
294+if [[ "$term_height" -lt 1 || "$term_width" -lt 1 ]]; then
295+    local stty_out=$( stty size )
296+    term_height="${stty_out% *}"
297+    term_width="${stty_out#* }"
298+fi
299+
300+integer status_height=3
301+integer status_width=term_width
302+integer status_page_height=1
303+integer status_page_width=term_width-2
304+
305+integer files_height=term_height-status_height
306+integer files_width=term_width/5
307+integer files_page_height=files_height-2
308+integer files_page_width=files_width-2
309+
310+integer body_height=term_height-status_height
311+integer body_width=term_width-files_width
312+integer body_page_height=body_height-2
313+integer body_page_width=body_width
314+
315+integer _from_what_idx_list_is_shown_1=1
316+integer current_1=1
317+
318+integer _from_what_idx_list_is_shown_2=1
319+integer current_2=1
320+integer hscroll_2=0
321+
322+integer active_window=0
323+
324+local ansi_mode="ansi"
325+[ -f ~/.config/znt/n-preview.conf ] && . ~/.config/znt/n-preview.conf
326+typeset -a hcmd
327+#if type pygmentize 2>/dev/null 1>&2; then
328+#    hcmd=( pygmentize -g )
329+if type highlight 2>/dev/null 1>&2; then
330+    hcmd=( highlight -q --force -O ansi )
331+elif type source-highlight 2>/dev/null 1>&2; then
332+    # Warning: source-highlight can have problems
333diff --git a/plugins/zsh-navigation-tools/znt-tmux.zsh b/plugins/zsh-navigation-tools/doc/znt-tmux.zsh
334rename from plugins/zsh-navigation-tools/znt-tmux.zsh
335rename to plugins/zsh-navigation-tools/doc/znt-tmux.zsh
336index 6a96e97a1662e89c971d021f5355724ae2db02ec..309c11a0bda3000b3f283f8fe70afa1321a6452d 100755
337--- a/plugins/zsh-navigation-tools/znt-tmux.zsh
338+++ b/plugins/zsh-navigation-tools/doc/znt-tmux.zsh
339@@ -12,7 +12,7 @@
340 # To use, put this line to your ~/.tmux.conf. The tool is invoked with:
341 # Ctrl+b h
342 #
343-# bind h run-shell -b "$ZNT_REPO_DIR/znt-tmux.zsh"
344+# bind h run-shell -b "$ZNT_REPO_DIR/doc/znt-tmux.zsh"
345 #
346 
347 # get and save the current active tmux pane id
348diff --git a/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh b/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
349index f015620f583b44d951d65a3cb2d1452b614d7c90..85ce87ca461d0ed070fdffb50aaa49ce618ef0b3 100644
350--- a/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
351+++ b/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
352@@ -8,7 +8,7 @@
353 #
354 
355 # According to the standard:
356-# http://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
357+# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
358 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
359 0="${${(M)0:#/*}:-$PWD/$0}"
360 export ZNT_REPO_DIR="${0:h}"