1 # Copy this file into /usr/share/zsh/site-functions/
2 # and add 'autoload n-env` to .zshrc
4 # This function allows to choose an environment variable
5 # for edition with vared
18 [ -f ~/.config/znt/n-list.conf ] && builtin source ~/.config/znt/n-list.conf
19 [ -f ~/.config/znt/n-env.conf ] && builtin source ~/.config/znt/n-env.conf
24 NLIST_REMEMBER_STATE=0
27 list=( "${(@M)list:#(#i)*$1*}" )
29 local NLIST_GREP_STRING="$1"
31 if [ "$#list" -eq 0 ]; then
32 echo "No matching variables"
36 list=( "${(@i)list}" )
39 if [ "$REPLY" -gt 0 ]; then
40 selected="$reply[REPLY]"
41 selected="${selected%%=*}"
42 echo "Editing \`$selected':"
43 print -rs "vared \"$selected\""
47 # vim: set filetype=zsh: