Is it a good idea to create a "Snippet Manager" plugin? #481
Replies: 2 comments 7 replies
-
Hey!
One final, and more boring, problem would be storing the snippet: the most straightforward way is just writing them to a text-file and loading that, but it should be possible to store it as lua bytecode, which can just be loaded and appended to, than stored again. |
Beta Was this translation helpful? Give feedback.
-
I do plan to store the snippet as a regular .lua file. I plan to start small & simple, only supporting insert nodes & text-only choice nodes. Speaking of Hydra, how are you using it? I'm trying it out to trigger LuaSnippets, but the big picture is still hazy atm. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @L3MON4D3 , thank you so much for the amazing plugin :)
Today I'd like to have a discussion about the snippet creation process.
LuaSnip and the Snippets created from it is awesome, but I can't really say the same for the process of creating those snippets.
Creating a Snippet requires too much context switching & fumbling around to get things done. My "quickest" way is to use
LuaSnipEdit
to jump to the snippet file, press<CR>
to create some white spaces, then pressjcs
tocreate snippet
(trigger a snippet to create snippet), then fumble around thinking of how to name the snippet, it's description, jump around to yank it's contents, more jumping for customizing the nodes usingfmt
, etc... You get the idea.I'm proposing & planning to create a "Snippet Creator / Manager" in the close future. And I'd love your input on this.
The results it outputs should be just a regular lua snippet file that is 100% compatible with LuaSnip.
The user, in their working buffer, select some text, press a key, the selected text would be replaced with extmarks that looks something like
{xxx}
, informing the user that part will be like the{}
in thefmt
snippet creation process.After marking those
placeholder
regions, the user would run a Command such asCreateSnippet...
, a pop up window should show up to give the user quick access to the settings they'd be interested in.I plan to start simple, just supporting insert nodes, simple choice nodes (text nodes / insert nodes as child only), etc... in the beginning.
Please let me know what you think about this idea. Thank you :)
Beta Was this translation helpful? Give feedback.
All reactions