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

Re: Official plugin manager?



Roman Perepelitsa wrote on Sat, 04 Jan 2020 16:41 +00:00:
> On Sat, Jan 4, 2020 at 5:28 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > Roman Perepelitsa wrote on Sat, 04 Jan 2020 15:46 +00:00:
> > >     zle -N zle-line-init my-zle-line-init
> > >
> > > This works. Until we source a plugin after setting up bindings and the
> > > plugin happens to hook zle-line-init without calling our hook. This
> > > time it's the plugin breaking our code rather than vise versa.
> >
> > That plugin is broken.
> 
> Before crossing a road on green light, I first check if there are cars
> speeding through the intersection. It's illegal for them to do so, but
> I'd rather turn my head than die being right.

The plugin is something you installed in your own home directory of your
own free will; the hypothesized driver was not placed on the road by you
of your own free will.  The two are not analogous.

Complaining about not being able to do something because of a plugin
you had installed is like complaining that you have to sleep with
earplugs after inviting someone to practice playing the trumpet in the
guest bedroom.

> I don't know of a downside to key translation I mentioned earlier, so
> I'm not even paying the price of turning my head when I use it (or
> maybe I do and just don't know it?). If I were using terminfo to fetch
> the escape codes for home and end keys, I would still have to hardcode
> escape codes for other keys or key combinations as terminfo is rather
> sparse in this regard, and I would still have to handle NumLock the
> same way I do now. Am I missing something?

Your argument boils down to saying you won't use the zle-line-init
feature for anything because some plugin has appropriated it for
itself.  It seems that it was concluded under the constraint that
the plugin must be installed.  Just throw that constraint out and
use the obvious solution: deinstall the plugin and use zle-line-init
however you like.  (That's the entire point of this thread: that users
should be able to customize their configurations to their liking.)

(Or fix the plugin, as I pointed out in the part of the mail you had snipped.)

As to making home and end work, that's not zshrc's job.  There is very
little about the problem of mapping escape sequences to zle widgets that
varies per user.



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