Generate yasnippet templates from org document.
Inspired by org-generate.
(el-get-bundle takeokunn/yasnippet-org)
(add-to-list 'load-path (locate-user-emacs-file "el-get/yasnippet-org"))
[1] Clone this repo:
$ git clone https://github.com/takeokunn/yasnippet-org /path/to/yasnippet-org/
[2] Add the path to your load-path in your Emacs configuration:
(add-to-list 'load-path "/path/to/yasnippet-org/")
[3] Require yasnippet-org
in your config:
(require 'yasnippet-org)
[1] Create ~/.emacs.d/yasnippets.org
.
[2] Edit ~/.emacs.d/yasnippets.org
like below.
* snippets
** go-mode/
*** append
#+begin_src snippet
# name: for append
# key: append
# --
$1 = append($1, $0)
#+end_src
*** case
#+begin_src snippet
# name: switch case
# key: case
# --
case $1:
$0
#+end_src
[3] Run M-x yasnippet-org
.
$ tree ~/.emacs.d
.emacs.d/
└── snippets/
└── go-mode
├── append
└── case
[4] Run M-x yas-reload-all
for reload yasnippet.
GPL v3