X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;f=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fzsh-navigation-tools%2Fn-options;fp=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fzsh-navigation-tools%2Fn-options;h=0000000000000000000000000000000000000000;hb=1a8e170bbe5c6641a26ab1ce2e6ce6c5c1faa4cd;hp=b1a934015654971b207521a0b7bb85a5a4835742;hpb=475ba35502579302593f4735c853c49ef1845dcb;p=dotfiles.git diff --git a/stow/oh-my-zsh/.oh-my-zsh/plugins/zsh-navigation-tools/n-options b/stow/oh-my-zsh/.oh-my-zsh/plugins/zsh-navigation-tools/n-options deleted file mode 100644 index b1a9340..0000000 --- a/stow/oh-my-zsh/.oh-my-zsh/plugins/zsh-navigation-tools/n-options +++ /dev/null @@ -1,84 +0,0 @@ -# Copy this file into /usr/share/zsh/site-functions/ -# and add 'autoload n-options` to .zshrc -# -# This function allows to browse and toggle shell's options -# -# Uses n-list - -#emulate -L zsh - -zmodload zsh/curses - -local IFS=" -" - -unset NLIST_COLORING_PATTERN - -[ -f ~/.config/znt/n-list.conf ] && builtin source ~/.config/znt/n-list.conf -[ -f ~/.config/znt/n-options.conf ] && builtin source ~/.config/znt/n-options.conf - -# TODO restore options -unsetopt localoptions - -integer kshoptionprint=0 -[[ -o kshoptionprint ]] && kshoptionprint=1 -setopt kshoptionprint - -local list -local selected -local option -local state - -# 0 - don't remember, 1 - remember, 2 - init once, then remember -NLIST_REMEMBER_STATE=2 - -local NLIST_GREP_STRING="${1:=}" - -while (( 1 )); do - list=( `setopt` ) - list=( "${(M)list[@]:#*${1:=}*}" ) - list=( "${list[@]:#kshoptionprint*}" ) - - if [ "$#list" -eq 0 ]; then - echo "No matching options" - break - fi - - local red=$'\x1b[00;31m' green=$'\x1b[00;32m' reset=$'\x1b[00;00m' - list=( "${list[@]/ off/${red} off$reset}" ) - #list=( "${list[@]/ on/${green} on$reset}" ) - list=( "${(i)list[@]}" ) - - n-list "${list[@]}" - - if [ "$REPLY" -gt 0 ]; then - [[ -o ksharrays ]] && selected="${reply[$(( REPLY - 1 ))]}" || selected="${reply[$REPLY]}" - option="${selected%% *}" - state="${selected##* }" - - if [[ -o globsubst ]]; then - unsetopt globsubst - state="${state%$reset}" - setopt globsubst - else - state="${state%$reset}" - fi - - # Toggle the option - if [ "$state" = "on" ]; then - echo "Setting |$option| to off" - unsetopt "$option" - else - echo "Setting |$option| to on" - setopt "$option" - fi - else - break - fi -done - -NLIST_REMEMBER_STATE=0 - -[[ "$kshoptionprint" -eq 0 ]] && unsetopt kshoptionprint - -# vim: set filetype=zsh: