DOOM yasnippets

To add yasnippets
to your DOOM emacs you can add a directory named snippets
to your DOOMDIR
. The DOOMDIR
is deafult set to ./.doom.d
. Here you can add your snippets. Fx i have a snippet for org-mode
that adds all relevant properties when i create a blog post. This snippet is named BlogPost
, and has the following contents
# -*- mode: snippet -*-
# name: BlogPost
# uuid:
# key: blogpost
# condition: t
# --
#+TITLE:
#+SLUG:
#+DATE: `(format-time-string "%Y-%m-%dT%H:%m:%S.%3NZ")`
#+TAGS[]:
#+AUTHOR:
#+DESCRIPTION:
#+CATEGORIES[]:
#+LANG: en
#+COVER:
This is pretty basic, but one thing to note, and this is not a DOOM
thing, but a yasnippet thing, i add a formatted date/time string when the snippet is activated. Now you can open a .org
file and when you start writing blogpost
, you will get a completion on the snippet, from a dropdown, when you pick it and press RET
, the snippet is activated, the lisp code is run, and the result is inserted into your org
document.
Read other posts