Skip to content

takeokunn/yasnippet-org

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

yasnippet-org

Generate yasnippet templates from org document.

Inspired by org-generate.

Install

via el-get

(el-get-bundle takeokunn/yasnippet-org)
(add-to-list 'load-path (locate-user-emacs-file "el-get/yasnippet-org"))

via manually

[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)

Usage

[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.

Author

takeokunn <bararararatty@gmail.com>

LICENSE

GPL v3