Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Support for inverting of options?



On Sep 15,  2:29am, Richard Hartmann wrote:
}
} I am wondering what other people think about an option like vim's
} 
}   :set invoption
} 
} What do you guys think about this? Is this a worthwhile feature
} or is this use case pretty much limited to myself?

Personally I almost never change the setting of an option, and when
I do I always know in which direction I want it to end up.  If this
is nothing but a way to change an option temporarily and then change
it back without thinking about whether you need the "no" prefix, then
I'd be inclined not to expend built-in code on it.

function :set {
  setopt nolocaloptions
  local o
  zmodload -i zsh/parameter
  for o; do setopt ${o/inv/${${options[${o/inv/}]/on/no}/off/}}; done
}

That works for everything but localoptions itself.



Messages sorted by: Reverse Date, Date, Thread, Author