Added a few orgmode yas-snippets

This commit is contained in:
James Patrick 2024-01-27 00:24:25 -05:00
parent 1db9687d66
commit 9a7b7f7e33
No known key found for this signature in database
6 changed files with 56 additions and 12 deletions

1
.gitignore vendored
View File

@ -9,7 +9,6 @@
################################################################################
# Configs
emacs/snippets
i3/config
vim/backup/*
vim/autoload/*

View File

@ -901,6 +901,44 @@ machine api.openai.com login apikey password TOKEN
)
)
#+end_src
** Snippets
We've enabled the [[doom-module:editor snippets][snippets module]] [[*Editor][earlier]]. This will give us use of the [[https://github.com/doomemacs/snippets][Doom Snippets package]], but we'll want to add our own as well. Custom snippets are added under =$DOOMDIR/snippets/= directory. Documentation on how to write snippets can be found at [[http://joaotavora.github.io/yasnippet/snippet-development.html][yas-snippet/documentation]] and [[https://github.com/doomemacs/snippets][doom-snippets github page]].
While we'll want to store these snippets in this orgmode document, using the =+snippets/create= & =snippets/edit= may be useful for creating these.
*** Orgmode
In my work todo and my roam notes I've been using a list elements with nerd-fonts icons under my section header to provide quick links for the context. Below are a few that I've been using.
-  [[github:github/example][github/example]]
#+begin_src snippet :tangle "snippets/org-mode/gh"
# -*- mode: snippet -*-
# name: Github Element
# uuid: gh
# key: gh
# --
-  ${1:repo}
#+end_src
-  [[example.com][example.com]]
#+begin_src snippet :tangle "snippets/org-mode/lk"
# -*- mode: snippet -*-
# name: Link Elment
# uuid: lk
# key: lk
# --
-  ${1:link}
#+end_src
-  [[https://example.com][Jira-12929]]
#+begin_src snippet :tangle "snippets/org-mode/ticket"
# -*- mode: snippet -*-
# name: Ticker Elment
# uuid: ticket
# key: ticket
# --
-  ${1:link}
#+end_src
* Content Stolen From
A large amount of the details listed here have been lifted from:
- [[https://tecosaur.github.io/emacs-config/][tecosaur's literate configuration]].

View File

@ -5,8 +5,6 @@ EMACSD := ~/.emacs.d
# Doom Config
DOOMD := ~/.doom.d
DOOM_URL := https://github.com/doomemacs/doomemacs
YASD := ~/.doom.d/snippets
YAS_URL := https://github.com/doomemacs/snippets
include ../lib/shared.mk
@ -35,7 +33,6 @@ setup:
$(report) header "emacs init"
$(mk_link) $(SRC_DIR) $(DOOMD)
$(MAKE) -C $(SRC_DIR) doom_init
$(MAKE) -C $(SRC_DIR) yas_init
fi
doom_init:
@ -48,11 +45,3 @@ doom_init:
else
$(report) debug "emacsd already exists. Skipping"
fi
yas_init:
if [ ! -e $(YASD) ] ; then
git clone $(YAS_URL) $(YASD) ; $(report) "YAS setup"
else
$(report) debug "YASD already exists. Skipping"
fi

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Github Element
# uuid: gh
# key: gh
# --
-  ${1:repo}

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Link Elment
# uuid: lk
# key: lk
# --
-  ${1:link}

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Ticker Elment
# uuid: ticket
# key: ticket
# --
-  ${1:link}