Do you use snippets often?

I’m currently writing tiddlywiki-cmp plugin, which is a code snippet completion for tiddlywiki-codemirror-6, although vscode tw5-syntax already has some code snippets, but I want to try to count here some of the most frequently used code snippets.

Of course, tiddlywiki-codemirror-6 can also support tiddlywiki builtin(or user added) code snippets.
builtin

1 Like

I never use the TW snippet mechanism, because it lacks keyboard navigation and searching through snippets.

That’s why I use my own solution with Auto Complete and a dictionary tiddler with snippets, see a demonstration here.

I use it mostly for symbols, e.g. I type ::degEnter for °, not really for code snippets. It looks to be functionally very similar to what your demo shows: some character sequence triggers a UI with search and keyboard navigation to select the snippet. So if I were using CM6 (although I don’t feel I need CM at all right now), I would most probably switch from my thing to the CM6 snippets.

1 Like

I was trying to think why it was that I almost never use snippets. This is it. But it’s worse – if you have a long tiddler, you have to scroll back to the top in order to see the drop down list. This breaks up the continuity of the thought process.

There are a few I use. The tiddler list one I use pretty regularly and I have 2 for my work journaling. Transclusion relegates snippets to a mnemonic device. Good keyboard navigation would be incredible (poor keyboard navigation is among the bigger drawbacks of TiddlyWiki in my mind).

I actually forgot to add the time related code snippet. (I just added it)

time

1 Like

In addition to these common types of auto-completion, are there other frequently needed auto-completions? Welcome to add.

1 Like

I use almost none of the editor buttons, only Excise and Toggle Preview, which I use through their keyboard shortcuts. So while I vaguely know that there’s a Snippets button, I’ve never paid it attention. I might well use the keyboard versions, though. If they look useful enough, it might get me to switch to CodeMirror, which I use in all sorts of places but not in TW.

I don’t use snippets as often as I would like, and I think this is for a number of reasons, but most of all we need to give the snipit mechanism a “little love” and your example @oeyoews is one. The gain more value in the case you demonstrate.

  • Personally the keyboard is not an issue for me, I am happy to use the mouse especially for meta items that replace many keystrokes give their content. Although I expect something can be gone to make them shortcut addressable.

What I find is in any given wiki I may want one or two snippets regularly and others occasionally. They are not there when I want them, and adding them is of little value unless you use them regularly.

So I found an approach that may help

Enhancing the tools for snippet management would go a long way to improving their value, specifically a process to accumulate snippets, you create across multiple wikis and perhaps an organised library. Additional snippet buttons dedicated to design or content authorship.

Without going into the details here, I just urge everyone to have an open mind and look into innovating in this space, as @oeyoews has done.

1 Like

now tiddlywiki-cmp plugin support emoji completion :tada:

Screenity video - Jan 8, 2024

inline hint is so cool :100:
image

3 Likes

Or buildin these macro code snippets into the cm6 plugin