diff --git a/README.org b/README.org index d0c62ba..82a53fb 100644 --- a/README.org +++ b/README.org @@ -1728,6 +1728,30 @@ taking tool has. org-roam-ui-open-on-start t)) #+end_src +* Snippets + +Snippets can be helpful in many situations. However they can also get in the way. +This is my *attempt* at making them helpful in most cases. + +** YASnippet + +[[https://github.com/joaotavora/yasnippet?tab=readme-ov-file][YASnippet]] is a template system for Emacs. It allows you to type an abbreviation +and automatically expand it into function templates. + +#+BEGIN_SRC emacs-lisp +(use-package yasnippet + :hook (prog-mode . yas-minor-mode)) +#+END_SRC + +For now I'm just using [[https://github.com/AndreaCrotti/yasnippet-snippets][YASnippet-snippets]] to provide all of my snippets. Custom +ones may be added in the future. + +#+BEGIN_SRC emacs-lisp +(use-package yasnippet-snippets + :after (yasnippet) + :init (yas-reload-all)) +#+END_SRC + * Optional Customizations Some of these seem to work well on any system so far, but won't automatically diff --git a/config.org b/config.org index 9523383..6c70b3d 100644 --- a/config.org +++ b/config.org @@ -242,6 +242,8 @@ features. #+INCLUDE: "config/org_mode.org" :minlevel 1 +#+INCLUDE: "config/snippets.org" :minlevel 1 + #+INCLUDE: "config/custom.org" :minlevel 1 #+begin_src emacs-lisp :exports none diff --git a/config/snippets.org b/config/snippets.org new file mode 100644 index 0000000..a3ad404 --- /dev/null +++ b/config/snippets.org @@ -0,0 +1,23 @@ +* Snippets + +Snippets can be helpful in many situations. However they can also get in the way. +This is my *attempt* at making them helpful in most cases. + +** YASnippet + +[[https://github.com/joaotavora/yasnippet?tab=readme-ov-file][YASnippet]] is a template system for Emacs. It allows you to type an abbreviation +and automatically expand it into function templates. + +#+BEGIN_SRC emacs-lisp +(use-package yasnippet + :hook (prog-mode . yas-minor-mode)) +#+END_SRC + +For now I'm just using [[https://github.com/AndreaCrotti/yasnippet-snippets][YASnippet-snippets]] to provide all of my snippets. Custom +ones may be added in the future. + +#+BEGIN_SRC emacs-lisp +(use-package yasnippet-snippets + :after (yasnippet) + :init (yas-reload-all)) +#+END_SRC