Shortcut to undo/delete a recently expanded snippet in LuaSnip #973
-
Say a user invokes a snippet, but realises that the snippet is incorrect/undesired. Is there the ability to clear the most recently expanded snippet via the LuaSnip API such that this can then be bound to a key-mapping in Neovim? For example (psuedo-code): vim.keymap.set({'i', 's'}, 'uu', '<cmd>lua require("luasnip").undo_expansion()<CR>') The documentation doesn't seem to mention anything relating to undoing or deleting a recently expanded snippet. The closest discussion I could find in the repository was #116 (comment) which mentions a function that "reverses the expansion of a snippet and puts the trigger-text back, mapping that to a key seems pretty ergonomic". This is basically what I am after (preferably with the option to not put the trigger-text back as well, as in some cases, one wants to remove the snippet (and trigger) because they have changed their mind about what needs to be typed/inserted). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
#797! |
Beta Was this translation helpful? Give feedback.
#797!
I haven't gotten to implementing it yet, but I'll do so, it seems desired :D