12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- ;; -*- lexical-binding: t -*-
- (defun my/yas-org-snippet ()
- (interactive)
- (yas-expand-snippet (yas-lookup-snippet "<org-mode"))
- (evil-insert-state))
- (defun my/yas-elisp-init-files-snippet ()
- (interactive)
- (yas-expand-snippet (yas-lookup-snippet "<elisp-init-files"))
- (evil-insert-state))
- (defun my/yas-c-mode-snippet ()
- (interactive)
- (yas-expand-snippet (yas-lookup-snippet "<c-mode"))
- (evil-insert-state))
- (defun my/cover-letter-file-snippet ()
- (interactive)
- (yas-expand-snippet (yas-lookup-snippet "<cover-letter"))
- (evil-insert-state))
- (defun my/blog-entry-file-snippet ()
- (interactive)
- (yas-expand-snippet (yas-lookup-snippet "<blog-entry"))
- (evil-insert-state))
- (defun my/yas-web-mode-snippet ()
- (interactive)
- (yas-expand-snippet (yas-lookup-snippet "<web-mode"))
- (evil-insert-state))
- ;;(use-package autoinsert)
- (add-hook 'find-file-hook 'auto-insert)
- (setq auto-insert-directory "~/.config/emacs/auto-insert-directory/")
- (setq auto-insert-mode t
- auto-insert-query t)
- (setq auto-insert-alist '((web-mode . [my/yas-web-mode-snippet])
- (c-mode . [my/yas-c-mode-snippet])
- (org-mode . [my/yas-org-snippet])))
- (add-to-list 'auto-insert-alist '((".*/lisp/.*\\.org$") . [my/yas-elisp-init-files-snippet]))
- (add-to-list 'auto-insert-alist '((".*/cover-letters.*\\.org$") . [my/cover-letter-file-snippet]))
- (add-to-list 'auto-insert-alist '((".*/my-wordpress-blog.*\\.org$") . [my/blog-entry-file-snippet]))
- (provide 'init-autoinsert)
|