summaryrefslogtreecommitdiff
path: root/plugins/zsh-navigation-tools/doc/install.sh
diff options
context:
space:
mode:
authorPhilipp Schmitt <pschmitt@users.noreply.github.com>2021-12-24 18:09:01 +0100
committerGitHub <noreply@github.com>2021-12-24 18:09:01 +0100
commit068feca15d09dce6747d0fb6cab2027b938e82bd (patch)
treef3603a06b14c7d51ea59bf745d811319207c7e17 /plugins/zsh-navigation-tools/doc/install.sh
parent4f90849425b4f40778e2fdb5281a1bae4117a7c2 (diff)
downloadzsh-068feca15d09dce6747d0fb6cab2027b938e82bd.tar.gz
zsh-068feca15d09dce6747d0fb6cab2027b938e82bd.tar.bz2
zsh-068feca15d09dce6747d0fb6cab2027b938e82bd.zip
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
Diffstat (limited to 'plugins/zsh-navigation-tools/doc/install.sh')
-rwxr-xr-xplugins/zsh-navigation-tools/doc/install.sh70
1 files changed, 70 insertions, 0 deletions
diff --git a/plugins/zsh-navigation-tools/doc/install.sh b/plugins/zsh-navigation-tools/doc/install.sh
new file mode 100755
index 000000000..2b71aa3b4
--- /dev/null
+++ b/plugins/zsh-navigation-tools/doc/install.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+if ! type git 2>/dev/null 1>&2; then
+ echo "Please install GIT first"
+ echo "Exiting"
+ exit 1
+fi
+
+#
+# Clone or pull
+#
+
+if ! test -d "$HOME/.config"; then
+ mkdir "$HOME/.config"
+fi
+
+if ! test -d "$HOME/.config/znt"; then
+ mkdir "$HOME/.config/znt"
+fi
+
+echo ">>> Downloading zsh-navigation-tools to ~/.config/znt"
+if test -d ~/.config/znt/zsh-navigation-tools; then
+ cd ~/.config/znt/zsh-navigation-tools
+ git pull origin master
+else
+ cd ~/.config/znt
+ git clone https://github.com/psprint/zsh-navigation-tools.git zsh-navigation-tools
+fi
+echo ">>> Done"
+
+#
+# Copy configs
+#
+
+echo ">>> Copying config files"
+
+cd ~/.config/znt
+
+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 "$i"; then
+ cp -v zsh-navigation-tools/.config/znt/$i .
+ fi
+done
+
+echo ">>> Done"
+
+#
+# Modify .zshrc
+#
+
+echo ">>> Updating .zshrc"
+if ! grep zsh-navigation-tools ~/.zshrc >/dev/null 2>&1; then
+ echo >> ~/.zshrc
+ echo "### ZNT's installer added snippet ###" >> ~/.zshrc
+ echo "fpath=( \"\$fpath[@]\" \"\$HOME/.config/znt/zsh-navigation-tools\" )" >> ~/.zshrc
+ 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
+ echo "autoload znt-usetty-wrapper znt-history-widget znt-cd-widget znt-kill-widget" >> ~/.zshrc
+ echo "alias naliases=n-aliases ncd=n-cd nenv=n-env nfunctions=n-functions nhistory=n-history" >> ~/.zshrc
+ echo "alias nkill=n-kill noptions=n-options npanelize=n-panelize nhelp=n-help" >> ~/.zshrc
+ echo "zle -N znt-history-widget" >> ~/.zshrc
+ echo "bindkey '^R' znt-history-widget" >> ~/.zshrc
+ echo "setopt AUTO_PUSHD HIST_IGNORE_DUPS PUSHD_IGNORE_DUPS" >> ~/.zshrc
+ echo "zstyle ':completion::complete:n-kill::bits' matcher 'r:|=** l:|=*'" >> ~/.zshrc
+ echo "### END ###" >> ~/.zshrc
+ echo ">>> Done"
+else
+ echo ">>> .zshrc already updated, not making changes"
+fi