X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;f=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fzsh-navigation-tools%2Fn-cd;fp=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fzsh-navigation-tools%2Fn-cd;h=0000000000000000000000000000000000000000;hb=1a8e170bbe5c6641a26ab1ce2e6ce6c5c1faa4cd;hp=48c6dbf4ecbc4d0b155c8f8d7a3b4d469680d4d4;hpb=475ba35502579302593f4735c853c49ef1845dcb;p=dotfiles.git diff --git a/stow/oh-my-zsh/.oh-my-zsh/plugins/zsh-navigation-tools/n-cd b/stow/oh-my-zsh/.oh-my-zsh/plugins/zsh-navigation-tools/n-cd deleted file mode 100644 index 48c6dbf..0000000 --- a/stow/oh-my-zsh/.oh-my-zsh/plugins/zsh-navigation-tools/n-cd +++ /dev/null @@ -1,71 +0,0 @@ -# Copy this file into /usr/share/zsh/site-functions/ -# and add 'autoload n-cd` to .zshrc -# -# This function allows to choose a directory from pushd stack -# -# Uses n-list - -emulate -L zsh - -setopt extendedglob pushdignoredups - -zmodload zsh/curses -local IFS=" -" - -# Unset before configuration is read -unset NLIST_COLORING_PATTERN - -[ -f ~/.config/znt/n-list.conf ] && builtin source ~/.config/znt/n-list.conf -[ -f ~/.config/znt/n-cd.conf ] && builtin source ~/.config/znt/n-cd.conf - -local list -local selected - -NLIST_REMEMBER_STATE=0 - -list=( `dirs -p` ) -list=( "${(@M)list:#(#i)*$1*}" ) - -local NLIST_GREP_STRING="$1" - -[ "$#list" -eq 0 ] && echo "No matching directories" - -if [ "$#hotlist" -ge 1 ]; then - typeset -a NLIST_NONSELECTABLE_ELEMENTS NLIST_HOP_INDEXES - local tmp_list_size="$#list" - NLIST_NONSELECTABLE_ELEMENTS=( $(( tmp_list_size+1 )) $(( tmp_list_size+2 )) ) - list=( "$list[@]" "" $'\x1b[00;31m'"Hotlist"$'\x1b[00;00m': "$hotlist[@]" ) - (( tmp_list_size+=3 )) - local middle_hop=$(( (tmp_list_size+$#list) / 2 )) - [[ "$middle_hop" -eq $tmp_list_size || "$middle_hop" -eq $#list ]] && middle_hop="" - [ "$tmp_list_size" -eq $#list ] && tmp_list_size="" - NLIST_HOP_INDEXES=( 1 $tmp_list_size $middle_hop $#list ) -else - [ "$#list" -eq 0 ] && return 1 -fi - -n-list "${list[@]}" - -if [ "$REPLY" -gt 0 ]; then - selected="$reply[REPLY]" - selected="${selected/#\~/$HOME}" - - (( NCD_DONT_PUSHD )) && setopt NO_AUTO_PUSHD - cd "$selected" - local code=$? - (( NCD_DONT_PUSHD )) && setopt AUTO_PUSHD - - if [ "$code" -eq "0" ]; then - # ZLE? - if [ "${(t)CURSOR}" = "integer-local-special" ]; then - zle -M "You have selected $selected" - else - echo "You have selected $selected" - fi - fi -else - [ "${(t)CURSOR}" = "integer-local-special" ] && zle redisplay -fi - -# vim: set filetype=zsh: