Added a few orgmode yas-snippets
This commit is contained in:
parent
1db9687d66
commit
9a7b7f7e33
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,7 +9,6 @@
|
|||
|
||||
################################################################################
|
||||
# Configs
|
||||
emacs/snippets
|
||||
i3/config
|
||||
vim/backup/*
|
||||
vim/autoload/*
|
||||
|
|
|
@ -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]].
|
||||
|
|
|
@ -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
|
||||
|
|
6
emacs/snippets/org-mode/gh
Normal file
6
emacs/snippets/org-mode/gh
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: Github Element
|
||||
# uuid: gh
|
||||
# key: gh
|
||||
# --
|
||||
- ${1:repo}
|
6
emacs/snippets/org-mode/lk
Normal file
6
emacs/snippets/org-mode/lk
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: Link Elment
|
||||
# uuid: lk
|
||||
# key: lk
|
||||
# --
|
||||
- ${1:link}
|
6
emacs/snippets/org-mode/ticket
Normal file
6
emacs/snippets/org-mode/ticket
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: Ticker Elment
|
||||
# uuid: ticket
|
||||
# key: ticket
|
||||
# --
|
||||
- ${1:link}
|
Loading…
Reference in New Issue
Block a user