joaotavora / yasnippet

A template system for Emacs
http://joaotavora.github.io/yasnippet/
2.81k stars 311 forks source link

Function to load snippets without confirmation #1202

Open lanceberge opened 3 months ago

lanceberge commented 3 months ago

Yasnippet by default prompts the user to enter a table, file path to save the snippet, and if they want to save the buffer. I found myself almost always applying the defaults, so I wrote a function that saves the snippet, loads it, and quits without any confirmation.

Testing

M-x yas-new-snippet Fill in a snippet M-x yas-load-snippet-buffer-and-close-noconfirm write out the key for the snippet you created and press <tab>

Mango0x45 commented 1 month ago

Instead of (car (cdr (car ...))) you can just do (cadar ...)

lanceberge commented 1 month ago

Cool, updated