syscfg/emacs/module/module-snippets.el

30 lines
670 B
EmacsLisp

;;; module-snippets.el --- text snippets -*- lexical-binding: t; -*-
;;;
;;; Commentary:
;;;
;;; Sometimes it's just too much effort to type the same shit over and
;;; over again.
;;;
;;; Code:
(require 'module-pkg)
(pkg/require 'yasnippet)
(pkg/require 'yasnippet-snippets)
(setq yas-snippet-dirs '("~/.config/emacs/snippets/"))
(yas-global-mode 1)
(global-set-key (kbd "C-x y i") #'yas-insert-snippet)
(global-set-key (kbd "C-x y n") #'yas-new-snippet)
(global-set-key (kbd "C-x y v") #'yas-visit-snippet-file)
(add-hook 'prog-mode-hook #'yas-minor-mode)
(add-hook 'org-mode-hook #'yas-minor-mode)
(provide 'module-snippets)
;;; module-snippets.el ends here.