VSCode/LSP snippet support for Emacs with Yasnippet.
main-demo.mp4
Translates VSCode/LSP snippets and expands them with Yasnippet.
Perfect for users who find yasnippet-snippets too limited and want access to the vast ecosystem of modern editor templates.
Default Snippets collection is Friendly Snippets
autodetection.mp4
tabstops.mp4
placeholders.mp4
choices.mp4
vars.mp4
(use-package snippy
:vc (:url "https://github.com/MiniApollo/snippy.git"
:branch "main"
:rev :newest)
:hook (after-init . global-snippy-minor-mode)
:custom
(snippy-global-languages '("global")) ;; Recomended
;; Optional
;; (snippy-install-dir (expand-file-name <Your location>))
;; Use different snippet collections
;; (snippy-source '("Your git repo" . "my-snippets-dir"))
:config
(snippy-install-or-update-snippets) ;; Autoupdate git repo
(add-hook 'completion-at-point-functions #'snippy-capf)) ;; Or merge them with Yasnippet or eglot capf- snippy-install-dir: Directory where to install/clone snippets.
- snippy-source: The source details for downloading snippets (Both needed).
- Repository URL
- Directory Name (Cloned repo dir name)
- snippy-global-languages: List of languages to enable globally across all major modes.
- snippy-emacs-to-vscode-lang-alist: Alist mapping Emacs major modes to VSCode language identifiers. Check languages in Friendly Snippets repo
- snippy-install-or-update-snippets: Install or update snippet git repo in snippy-install-dir.
- snippy-refresh-snippets: Force an update on the snippets for the current buffer.
- snippy-expand: Expand snippet by prefix.
- snippy-expand-snippet: Expand VSCode snippet body.
- snippy-capf: Complete with snippy at point.
- snippy-minor-mode: Toggle snippy in the current buffer.
- global-snippy-minor-mode: Toggle snippy in all buffers.
This package was made as a challenge to create an Emacs package as fast as possible.
AI was heavily used. So there might be some weird/bad code here and there :P
This package was made in two days. I think it turned out really good. Enjoy.