3 if ! type git 2>/dev/null 1>&2; then
4 echo "Please install GIT first"
13 if ! test -d "$HOME/.config"; then
17 if ! test -d "$HOME/.config/znt"; then
18 mkdir "$HOME/.config/znt"
21 echo ">>> Downloading zsh-navigation-tools to ~/.config/znt"
22 if test -d ~/.config/znt/zsh-navigation-tools; then
23 cd ~/.config/znt/zsh-navigation-tools
24 git pull origin master
27 git clone https://github.com/psprint/zsh-navigation-tools.git zsh-navigation-tools
35 echo ">>> Copying config files"
39 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
42 if ! test -f "$i"; then
43 cp -v zsh-navigation-tools/.config/znt/$i .
53 echo ">>> Updating .zshrc"
54 if ! grep zsh-navigation-tools ~/.zshrc >/dev/null 2>&1; then
56 echo "### ZNT's installer added snippet ###" >> ~/.zshrc
57 echo "fpath=( \"\$fpath[@]\" \"\$HOME/.config/znt/zsh-navigation-tools\" )" >> ~/.zshrc
58 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
59 echo "autoload znt-usetty-wrapper znt-history-widget znt-cd-widget znt-kill-widget" >> ~/.zshrc
60 echo "alias naliases=n-aliases ncd=n-cd nenv=n-env nfunctions=n-functions nhistory=n-history" >> ~/.zshrc
61 echo "alias nkill=n-kill noptions=n-options npanelize=n-panelize nhelp=n-help" >> ~/.zshrc
62 echo "zle -N znt-history-widget" >> ~/.zshrc
63 echo "bindkey '^R' znt-history-widget" >> ~/.zshrc
64 echo "setopt AUTO_PUSHD HIST_IGNORE_DUPS PUSHD_IGNORE_DUPS" >> ~/.zshrc
65 echo "zstyle ':completion::complete:n-kill::bits' matcher 'r:|=** l:|=*'" >> ~/.zshrc
66 echo "### END ###" >> ~/.zshrc
69 echo ">>> .zshrc already updated, not making changes"