-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-yas.el
30 lines (25 loc) · 846 Bytes
/
init-yas.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(use-package yasnippet
:init
(setq yas-snippet-dirs (list (expand-file-name "snippets" user-emacs-directory)))
:demand t
:config
(yas-global-mode 1)
(general-define-key
:keymaps 'yas-keymap
"TAB" nil
"<tab>" nil
"<return>" #'yas-next-field
"C-g" 'jester/abort-company-or-yas
"C-d" nil
"S-<backspace>" 'yas-skip-and-clear-or-delete-char)
(jester/with-leader
"s v" 'yas-visit-snippet-file
"s n" 'yas-new-snippet)
(jester/with-major-leader 'snippet-mode-map
"l" 'yas-load-snippet-buffer)
(defun jester/yas-expand-no-prompt ()
"Like `yas-expand', but unlike `yas-expand', who prompts when same snippet exist in parent and child mode, this function just use the one in child mode."
(interactive)
(let ((yas-prompt-functions '(yas-no-prompt)))
(yas-expand))))
(provide 'init-yas)