Nyxt Built In Hackable Snippets

What do people think of having snippets in nyxt?

Like if our browsing habits were not bad enough now I want to supercharge them with snippets.

I was inspired a bit by using tempel recently: GitHub - minad/tempel: TempEl - Simple templates for Emacs

Does it makes sense to have snippets in the minibuffer or elsewhere in nyxt?

This is mostly a general idea atm. I’m curious what the community thinks of concretizing this idea a bit or sharing ideas around ways this might be implemented given we were to pursue such a thing.

We have snippets for usage inside text areas but not in the minibuffer or in commands. That’s a fascinating concept I would like to meditate on. Thanks for bringing this up!

1 Like

Is there docs for the current snippet feature in nyxt?

Not sure why I’m so bad at finding docs heh

We have snippets for usage inside text areas

Are we talking about the same thing? Snippets as in, Emacs’ yasnippet or TextMate’s snippets or this TempEl package I haven’t seen before now.

Well, we have a similar thing already: Autofills. The shortcomings of those are:

  • they don’t (yet) have a keybinging in prompt-buffer,
  • there’s no easy syntax for prompting, you’d have to do something like
(make-instance
   #+nyxt-2 'nyxt:autofill
   #+nyxt-3 'nyxt/autofill-mode:autofill
   :name "Debug"
   :fill (lambda () (format nil "Hello, ~a" (prompt1 :prompt "What's your name?" :sources 'prompter:raw-source)))))

but it should be possible to hack up, e.g., an YASnippet alternative on top of those.