Move default snippets library to feature/snippets
Removes the +snippets flag from config/default. The default snippets can be disabled by disabling the emacs-snippets package.
This commit is contained in:
parent
85ea30377f
commit
91b76d8437
8 changed files with 32 additions and 28 deletions
|
@ -156,5 +156,4 @@
|
|||
;; provides a Spacemacs-inspired keybinding scheme, a custom yasnippet
|
||||
;; library, and additional ex commands for evil-mode. Use it as a
|
||||
;; reference for your own modules.
|
||||
(default +bindings +snippets +evil-commands))
|
||||
|
||||
(default +bindings +evil-commands))
|
||||
|
|
|
@ -766,9 +766,9 @@
|
|||
(:desc "snippets" :prefix "s"
|
||||
:desc "New snippet" :n "n" #'yas-new-snippet
|
||||
:desc "Insert snippet" :nv "i" #'yas-insert-snippet
|
||||
:desc "Find snippet" :n "s" #'+default/find-in-snippets
|
||||
:desc "Find snippet for mode" :n "S" #'+default/browse-snippets
|
||||
:desc "Find global snippet" :n "/" #'yas-visit-snippet-file
|
||||
:desc "Jump to mode snippet" :n "/" #'yas-visit-snippet-file
|
||||
:desc "Jump to snippet" :n "s" #'+snippets/find-file
|
||||
:desc "Browse snippets" :n "S" #'+snippets/browse
|
||||
:desc "Reload snippets" :n "r" #'yas-reload-all))
|
||||
|
||||
(:desc "toggle" :prefix "t"
|
||||
|
|
|
@ -34,13 +34,6 @@
|
|||
(defun +default/find-in-notes ()
|
||||
(interactive) (doom-project-find-file org-directory))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/browse-snippets ()
|
||||
(interactive) (doom-project-browse +snippets-dir))
|
||||
;;;###autoload
|
||||
(defun +default/find-in-snippets ()
|
||||
(interactive) (doom-project-find-file +snippets-dir))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/find-in-config ()
|
||||
"Open a file somewhere in `doom-private-dir' via a fuzzy filename search."
|
||||
|
|
|
@ -3,14 +3,6 @@
|
|||
(if (featurep! +bindings) (load! "+bindings"))
|
||||
|
||||
|
||||
;;
|
||||
;; Packages
|
||||
|
||||
(def-package! emacs-snippets
|
||||
:if (featurep! +snippets)
|
||||
:after yasnippet)
|
||||
|
||||
|
||||
;;
|
||||
;; Config
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; config/default/packages.el
|
||||
|
||||
(when (featurep! +snippets)
|
||||
(package! emacs-snippets
|
||||
:recipe (:fetcher github
|
||||
:repo "hlissner/emacs-snippets"
|
||||
:files ("*"))))
|
|
@ -101,3 +101,22 @@ buggy behavior when <delete> is pressed in an empty field."
|
|||
(if (symbol-value mode)
|
||||
(yas-activate-extra-mode mode)
|
||||
(yas-deactivate-extra-mode mode)))
|
||||
|
||||
|
||||
;;
|
||||
;; Commands
|
||||
|
||||
;;;###autoload
|
||||
(defun +snippets/browse (arg)
|
||||
"TODO"
|
||||
(interactive "P")
|
||||
(doom-project-browse +snippets-dir))
|
||||
|
||||
;;;###autoload
|
||||
(defun +snippets/find-file ()
|
||||
"TODO"
|
||||
(interactive)
|
||||
(if (file-directory-p +snippets-dir)
|
||||
(doom-project-find-file +snippets-dir)
|
||||
(yas-visit-snippet-file)))
|
||||
|
||||
|
|
|
@ -50,3 +50,8 @@
|
|||
|
||||
;; `auto-yasnippet'
|
||||
(setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/"))
|
||||
|
||||
|
||||
;; default snippets library
|
||||
(def-package! emacs-snippets
|
||||
:after yasnippet)
|
||||
|
|
|
@ -4,3 +4,7 @@
|
|||
(package! yasnippet)
|
||||
(package! auto-yasnippet)
|
||||
|
||||
(package! emacs-snippets
|
||||
:recipe (:fetcher github
|
||||
:repo "hlissner/emacs-snippets"
|
||||
:files ("*")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue