2015-04-03 04:28:13 +00:00
|
|
|
;;; packages.el --- Auto-completion Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2015-04-03 04:28:13 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
(setq auto-completion-packages
|
2015-05-06 07:28:50 +00:00
|
|
|
'(
|
2018-01-15 04:24:48 +00:00
|
|
|
auto-yasnippet
|
2015-05-06 07:28:50 +00:00
|
|
|
auto-complete
|
2018-08-08 08:46:33 +00:00
|
|
|
ac-ispell
|
2015-05-06 07:28:50 +00:00
|
|
|
company
|
2019-10-13 02:11:10 +00:00
|
|
|
(company-box :toggle auto-completion-use-company-box)
|
|
|
|
(all-the-icons :toggle auto-completion-use-company-box)
|
2016-08-29 12:58:17 +00:00
|
|
|
(company-quickhelp :toggle auto-completion-enable-help-tooltip)
|
2015-05-06 07:28:50 +00:00
|
|
|
company-statistics
|
2018-06-05 22:20:16 +00:00
|
|
|
counsel
|
2017-02-02 19:56:44 +00:00
|
|
|
fuzzy
|
2017-07-03 07:52:54 +00:00
|
|
|
(helm-company :requires helm)
|
|
|
|
(helm-c-yasnippet :requires helm)
|
2015-05-06 07:28:50 +00:00
|
|
|
hippie-exp
|
2018-06-06 02:45:37 +00:00
|
|
|
(ivy-yasnippet :requires ivy)
|
2018-01-15 04:24:48 +00:00
|
|
|
smartparens
|
2016-04-10 15:55:19 +00:00
|
|
|
yasnippet
|
2018-01-14 21:51:20 +00:00
|
|
|
yasnippet-snippets
|
2015-05-06 07:28:50 +00:00
|
|
|
))
|
2015-04-03 04:28:13 +00:00
|
|
|
|
2015-08-14 03:02:16 +00:00
|
|
|
;; TODO replace by company-ispell which comes with company
|
|
|
|
;; to be moved to spell-checking layer as well
|
2015-04-03 04:28:13 +00:00
|
|
|
(defun auto-completion/init-ac-ispell ()
|
|
|
|
(use-package ac-ispell
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-04-03 04:28:13 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq ac-ispell-requires 4)
|
2015-09-29 05:07:57 +00:00
|
|
|
(with-eval-after-load 'auto-complete
|
|
|
|
(ac-ispell-setup))
|
2015-04-03 04:28:13 +00:00
|
|
|
;; (add-hook 'markdown-mode-hook 'ac-ispell-ac-setup)
|
|
|
|
)))
|
|
|
|
|
|
|
|
(defun auto-completion/init-auto-complete ()
|
|
|
|
(use-package auto-complete
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-04-03 04:28:13 +00:00
|
|
|
:init
|
|
|
|
(setq ac-auto-start 0
|
2018-01-01 05:05:02 +00:00
|
|
|
ac-delay auto-completion-idle-delay
|
2015-04-03 04:28:13 +00:00
|
|
|
ac-quick-help-delay 1.
|
|
|
|
ac-use-fuzzy t
|
|
|
|
ac-fuzzy-enable t
|
|
|
|
ac-comphist-file (concat spacemacs-cache-directory "ac-comphist.dat")
|
2015-04-03 17:30:26 +00:00
|
|
|
;; use 'complete when auto-complete is disabled
|
|
|
|
tab-always-indent 'complete
|
2015-04-03 04:28:13 +00:00
|
|
|
ac-dwim t)
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(require 'auto-complete-config)
|
2015-04-03 17:30:26 +00:00
|
|
|
(setq-default ac-sources '(ac-source-abbrev
|
|
|
|
ac-source-dictionary
|
|
|
|
ac-source-words-in-same-mode-buffers))
|
2017-07-02 13:48:06 +00:00
|
|
|
(when (configuration-layer/package-used-p 'yasnippet)
|
2018-01-15 04:28:28 +00:00
|
|
|
(add-to-list 'ac-sources 'ac-source-yasnippet))
|
2015-04-03 04:28:13 +00:00
|
|
|
(add-to-list 'completion-styles 'initials t)
|
|
|
|
(define-key ac-completing-map (kbd "C-j") 'ac-next)
|
|
|
|
(define-key ac-completing-map (kbd "C-k") 'ac-previous)
|
|
|
|
(define-key ac-completing-map (kbd "<S-tab>") 'ac-previous)
|
2015-04-06 20:02:14 +00:00
|
|
|
(spacemacs|diminish auto-complete-mode " ⓐ" " a"))))
|
2015-04-03 04:28:13 +00:00
|
|
|
|
2018-01-15 04:24:48 +00:00
|
|
|
(defun auto-completion/init-auto-yasnippet ()
|
|
|
|
(use-package auto-yasnippet
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2018-01-15 04:24:48 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq aya-persist-snippets-dir
|
|
|
|
(or auto-completion-private-snippets-directory
|
2018-06-25 06:16:27 +00:00
|
|
|
(concat spacemacs-private-directory "snippets/")))
|
2018-01-15 04:24:48 +00:00
|
|
|
(spacemacs/declare-prefix "iS" "auto-yasnippet")
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"iSc" 'aya-create
|
|
|
|
"iSe" 'spacemacs/auto-yasnippet-expand
|
|
|
|
"iSw" 'aya-persist-snippet))))
|
|
|
|
|
2015-04-03 04:28:13 +00:00
|
|
|
(defun auto-completion/init-company ()
|
|
|
|
(use-package company
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-04-03 04:28:13 +00:00
|
|
|
:init
|
2015-04-06 20:49:53 +00:00
|
|
|
(progn
|
2018-01-01 05:05:02 +00:00
|
|
|
(setq company-idle-delay auto-completion-idle-delay
|
2015-04-06 20:49:53 +00:00
|
|
|
company-minimum-prefix-length 2
|
|
|
|
company-require-match nil
|
|
|
|
company-dabbrev-ignore-case nil
|
2016-02-11 10:12:49 +00:00
|
|
|
company-dabbrev-downcase nil)
|
2015-04-22 10:45:27 +00:00
|
|
|
|
2016-02-11 10:12:49 +00:00
|
|
|
(add-hook 'company-completion-started-hook 'company-turn-off-fci)
|
|
|
|
(add-hook 'company-completion-finished-hook 'company-maybe-turn-on-fci)
|
|
|
|
(add-hook 'company-completion-cancelled-hook 'company-maybe-turn-on-fci))
|
2015-04-03 04:28:13 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2015-04-06 20:02:14 +00:00
|
|
|
(spacemacs|diminish company-mode " ⓐ" " a")
|
2015-04-30 03:49:59 +00:00
|
|
|
|
|
|
|
;; key bindings
|
2015-05-04 04:13:58 +00:00
|
|
|
(defun spacemacs//company-complete-common-or-cycle-backward ()
|
|
|
|
"Complete common prefix or cycle backward."
|
|
|
|
(interactive)
|
|
|
|
(company-complete-common-or-cycle -1))
|
2015-05-06 02:32:28 +00:00
|
|
|
(spacemacs//auto-completion-set-RET-key-behavior 'company)
|
|
|
|
(spacemacs//auto-completion-set-TAB-key-behavior 'company)
|
|
|
|
(spacemacs//auto-completion-setup-key-sequence 'company)
|
2016-04-22 01:29:20 +00:00
|
|
|
|
|
|
|
(let ((map company-active-map))
|
|
|
|
(define-key map (kbd "C-/") 'company-search-candidates)
|
|
|
|
(define-key map (kbd "C-M-/") 'company-filter-candidates)
|
|
|
|
(define-key map (kbd "C-d") 'company-show-doc-buffer))
|
|
|
|
(add-hook 'spacemacs-editing-style-hook 'spacemacs//company-active-navigation)
|
2016-04-22 03:26:20 +00:00
|
|
|
;; ensure that the correct bindings are set at startup
|
|
|
|
(spacemacs//company-active-navigation dotspacemacs-editing-style)
|
2016-04-22 01:29:20 +00:00
|
|
|
|
2015-04-03 04:28:13 +00:00
|
|
|
(setq company-transformers '(spacemacs//company-transformer-cancel
|
2015-04-09 03:57:22 +00:00
|
|
|
company-sort-by-occurrence)))))
|
2015-04-03 04:28:13 +00:00
|
|
|
|
2015-05-06 07:28:50 +00:00
|
|
|
(defun auto-completion/init-company-statistics ()
|
|
|
|
(use-package company-statistics
|
2015-05-07 02:22:01 +00:00
|
|
|
:if auto-completion-enable-sort-by-usage
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-05-06 07:28:50 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2015-05-07 02:22:01 +00:00
|
|
|
(setq company-statistics-file (concat spacemacs-cache-directory
|
|
|
|
"company-statistics-cache.el"))
|
2015-05-06 07:28:50 +00:00
|
|
|
(add-hook 'company-mode-hook 'company-statistics-mode))))
|
|
|
|
|
2018-06-06 07:48:11 +00:00
|
|
|
(defun auto-completion/pre-init-counsel ()
|
2018-06-05 22:20:16 +00:00
|
|
|
(spacemacs|use-package-add-hook company
|
|
|
|
:post-config
|
|
|
|
(define-key company-active-map (kbd "C-/") 'counsel-company)))
|
|
|
|
|
2017-02-02 19:56:44 +00:00
|
|
|
(defun auto-completion/init-fuzzy ()
|
2018-03-04 04:37:53 +00:00
|
|
|
(use-package fuzzy :defer t))
|
2017-02-02 19:56:44 +00:00
|
|
|
|
2015-04-03 04:28:13 +00:00
|
|
|
(defun auto-completion/init-company-quickhelp ()
|
|
|
|
(use-package company-quickhelp
|
2016-08-26 12:37:05 +00:00
|
|
|
:commands company-quickhelp-manual-begin
|
2016-02-11 10:12:49 +00:00
|
|
|
:init
|
2016-08-29 12:58:17 +00:00
|
|
|
(spacemacs|do-after-display-system-init
|
|
|
|
(with-eval-after-load 'company
|
2016-08-26 12:37:05 +00:00
|
|
|
(setq company-frontends (delq 'company-echo-metadata-frontend company-frontends))
|
|
|
|
(define-key company-active-map (kbd "M-h") #'company-quickhelp-manual-begin)
|
|
|
|
(unless (eq auto-completion-enable-help-tooltip 'manual)
|
|
|
|
(company-quickhelp-mode))))))
|
2015-04-23 02:03:04 +00:00
|
|
|
|
2019-10-13 02:11:10 +00:00
|
|
|
(defun auto-completion/init-all-the-icons ()
|
|
|
|
(use-package all-the-icons
|
|
|
|
:after company
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(eval-and-compile
|
|
|
|
;; Icons selected by liguangsheng
|
|
|
|
;; https://github.com/liguangsheng/emacsd/blob/master/lisp/init-completion.el
|
|
|
|
(defun my-company-box-icon (family icon &rest args)
|
|
|
|
"Defines icons using `all-the-icons' for `company-box'."
|
|
|
|
(when icon
|
|
|
|
(let ((icon (pcase family
|
|
|
|
('octicon (all-the-icons-octicon icon :height 0.8 :v-adjust -0.05 args))
|
|
|
|
('faicon (all-the-icons-faicon icon :height 0.8 :v-adjust -0.0575))
|
|
|
|
('material (all-the-icons-material icon :height 0.8 :v-adjust -0.225 args))
|
|
|
|
('alltheicon (all-the-icons-alltheicon icon :height 0.8 args)))))
|
|
|
|
(unless (symbolp icon)
|
|
|
|
(concat icon
|
|
|
|
(propertize " " 'face 'variable-pitch)))))))
|
|
|
|
(setq company-box-icons-all-the-icons
|
|
|
|
`((Unknown . ,(my-company-box-icon 'octicon "file-text"))
|
|
|
|
(Text . ,(my-company-box-icon 'faicon "file-text-o"))
|
|
|
|
(Method . ,(my-company-box-icon 'faicon "cube"))
|
|
|
|
(Function . ,(my-company-box-icon 'faicon "cube"))
|
|
|
|
(Constructor . ,(my-company-box-icon 'faicon "cube"))
|
|
|
|
(Field . ,(my-company-box-icon 'faicon "tag"))
|
|
|
|
(Variable . ,(my-company-box-icon 'faicon "tag"))
|
|
|
|
(Class . ,(my-company-box-icon 'faicon "cog"))
|
|
|
|
(Interface . ,(my-company-box-icon 'faicon "cogs"))
|
|
|
|
(Module . ,(my-company-box-icon 'alltheicon "less"))
|
|
|
|
(Property . ,(my-company-box-icon 'faicon "wrench"))
|
|
|
|
(Unit . ,(my-company-box-icon 'faicon "tag"))
|
|
|
|
(Value . ,(my-company-box-icon 'faicon "tag"))
|
|
|
|
(Enum . ,(my-company-box-icon 'faicon "file-text-o"))
|
|
|
|
(Keyword . ,(my-company-box-icon 'material "format_align_center"))
|
|
|
|
(Snippet . ,(my-company-box-icon 'material "content_paste"))
|
|
|
|
(Color . ,(my-company-box-icon 'material "palette"))
|
|
|
|
(File . ,(my-company-box-icon 'faicon "file"))
|
|
|
|
(Reference . ,(my-company-box-icon 'faicon "tag"))
|
|
|
|
(Folder . ,(my-company-box-icon 'faicon "folder"))
|
|
|
|
(EnumMember . ,(my-company-box-icon 'faicon "tag"))
|
|
|
|
(Constant . ,(my-company-box-icon 'faicon "tag"))
|
|
|
|
(Struct . ,(my-company-box-icon 'faicon "cog"))
|
|
|
|
(Event . ,(my-company-box-icon 'faicon "bolt"))
|
|
|
|
(Operator . ,(my-company-box-icon 'faicon "tag"))
|
|
|
|
(TypeParameter . ,(my-company-box-icon 'faicon "cog"))
|
|
|
|
(Template . ,(my-company-box-icon 'octicon "file-code")))))))
|
|
|
|
|
|
|
|
(defun auto-completion/init-company-box ()
|
|
|
|
(use-package company-box
|
|
|
|
:hook '(company-mode . company-box-mode)
|
|
|
|
:commands 'company-box-doc-manually
|
|
|
|
:init (setq company-box-icons-alist 'company-box-icons-all-the-icons)
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(spacemacs|hide-lighter company-box-mode)
|
|
|
|
(setq company-box-backends-colors nil
|
|
|
|
company-box-max-candidates 1000
|
|
|
|
company-box-doc-enable nil)
|
|
|
|
(add-hook 'company-box-selection-hook
|
|
|
|
(lambda (selection frame) (company-box-doc--hide frame)))
|
2019-12-18 08:58:56 +00:00
|
|
|
(cl-case auto-completion-enable-help-tooltip
|
2019-10-13 02:11:10 +00:00
|
|
|
('manual (define-key company-active-map
|
|
|
|
(kbd "M-h") #'company-box-doc-manually))
|
|
|
|
('t (setq company-box-doc-enable t))))))
|
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun auto-completion/init-helm-c-yasnippet ()
|
|
|
|
(use-package helm-c-yasnippet
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-05-30 02:39:21 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(spacemacs/set-leader-keys "is" 'spacemacs/helm-yas)
|
|
|
|
(setq helm-c-yas-space-match-any-greedy t))))
|
2015-04-23 02:03:04 +00:00
|
|
|
|
2018-06-06 11:28:44 +00:00
|
|
|
(defun auto-completion/pre-init-helm-company ()
|
|
|
|
(spacemacs|use-package-add-hook company
|
|
|
|
:post-config
|
|
|
|
(use-package helm-company
|
|
|
|
:defer t
|
|
|
|
:init
|
2016-05-30 02:39:21 +00:00
|
|
|
(define-key company-active-map (kbd "C-/") 'helm-company))))
|
2018-06-06 11:28:44 +00:00
|
|
|
(defun auto-completion/init-helm-company ())
|
2015-10-09 16:14:23 +00:00
|
|
|
|
2015-04-23 02:03:04 +00:00
|
|
|
(defun auto-completion/init-hippie-exp ()
|
2015-05-06 07:28:50 +00:00
|
|
|
;; replace dabbrev-expand
|
2015-04-23 02:03:04 +00:00
|
|
|
(global-set-key (kbd "M-/") 'hippie-expand)
|
2016-02-01 14:23:55 +00:00
|
|
|
(define-key evil-insert-state-map [remap evil-complete-previous] 'hippie-expand)
|
2015-04-23 02:03:04 +00:00
|
|
|
(setq hippie-expand-try-functions-list
|
|
|
|
'(
|
|
|
|
;; Try to expand word "dynamically", searching the current buffer.
|
|
|
|
try-expand-dabbrev
|
|
|
|
;; Try to expand word "dynamically", searching all other buffers.
|
|
|
|
try-expand-dabbrev-all-buffers
|
|
|
|
;; Try to expand word "dynamically", searching the kill ring.
|
|
|
|
try-expand-dabbrev-from-kill
|
|
|
|
;; Try to complete text as a file name, as many characters as unique.
|
|
|
|
try-complete-file-name-partially
|
|
|
|
;; Try to complete text as a file name.
|
|
|
|
try-complete-file-name
|
|
|
|
;; Try to expand word before point according to all abbrev tables.
|
|
|
|
try-expand-all-abbrevs
|
|
|
|
;; Try to complete the current line to an entire line in the buffer.
|
|
|
|
try-expand-list
|
|
|
|
;; Try to complete the current line to an entire line in the buffer.
|
|
|
|
try-expand-line
|
|
|
|
;; Try to complete as an Emacs Lisp symbol, as many characters as
|
|
|
|
;; unique.
|
|
|
|
try-complete-lisp-symbol-partially
|
|
|
|
;; Try to complete word as an Emacs Lisp symbol.
|
|
|
|
try-complete-lisp-symbol))
|
2017-07-02 13:48:06 +00:00
|
|
|
(when (configuration-layer/package-used-p 'yasnippet)
|
2015-04-23 02:03:04 +00:00
|
|
|
;; Try to expand yasnippet snippets based on prefix
|
2018-01-15 04:28:28 +00:00
|
|
|
(add-to-list 'hippie-expand-try-functions-list 'yas-hippie-try-expand)))
|
2015-04-23 02:03:04 +00:00
|
|
|
|
2018-06-06 02:45:37 +00:00
|
|
|
(defun auto-completion/init-ivy-yasnippet ()
|
|
|
|
(use-package ivy-yasnippet
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq ivy-yasnippet-expand-keys nil)
|
|
|
|
(spacemacs/set-leader-keys "is" 'spacemacs/ivy-yas))))
|
|
|
|
|
2018-01-15 04:24:48 +00:00
|
|
|
(defun auto-completion/post-init-smartparens ()
|
|
|
|
(with-eval-after-load 'smartparens
|
|
|
|
(add-hook 'yas-before-expand-snippet-hook
|
|
|
|
#'spacemacs//smartparens-disable-before-expand-snippet)
|
|
|
|
(add-hook 'yas-after-exit-snippet-hook
|
|
|
|
#'spacemacs//smartparens-restore-after-exit-snippet)))
|
2018-01-14 21:51:20 +00:00
|
|
|
|
2015-04-23 02:03:04 +00:00
|
|
|
(defun auto-completion/init-yasnippet ()
|
|
|
|
(use-package yasnippet
|
2018-04-26 19:43:50 +00:00
|
|
|
:commands (yas-global-mode yas-minor-mode yas-activate-extra-mode)
|
2015-04-23 02:03:04 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2015-08-31 12:01:26 +00:00
|
|
|
;; We don't want undefined variable errors
|
|
|
|
(defvar yas-global-mode nil)
|
2016-01-07 05:14:32 +00:00
|
|
|
(setq yas-triggers-in-field t
|
|
|
|
yas-wrap-around-region t
|
|
|
|
helm-yas-display-key-on-candidate t)
|
|
|
|
;; on multiple keys, fall back to completing read
|
|
|
|
;; typically this means helm
|
|
|
|
(setq yas-prompt-functions '(yas-completing-prompt))
|
2015-04-30 03:49:59 +00:00
|
|
|
;; disable yas minor mode map
|
|
|
|
;; use hippie-expand instead
|
|
|
|
(setq yas-minor-mode-map (make-sparse-keymap))
|
2015-05-21 23:00:27 +00:00
|
|
|
;; this makes it easy to get out of a nested expansion
|
2016-01-07 05:14:32 +00:00
|
|
|
(define-key yas-minor-mode-map (kbd "M-s-/") 'yas-next-field)
|
|
|
|
;; configure snippet directories
|
|
|
|
(let* ((spacemacs--auto-completion-dir
|
2016-07-17 19:00:43 +00:00
|
|
|
(configuration-layer/get-layer-local-dir 'auto-completion))
|
2016-11-11 12:12:09 +00:00
|
|
|
(emacs-directory-snippets-dir (concat
|
2018-06-25 06:16:27 +00:00
|
|
|
spacemacs-private-directory
|
2016-11-11 12:12:09 +00:00
|
|
|
"snippets/"))
|
2016-01-09 02:56:49 +00:00
|
|
|
(spacemacs-layer-snippets-dir (expand-file-name
|
2016-01-07 05:14:32 +00:00
|
|
|
"snippets"
|
|
|
|
spacemacs--auto-completion-dir))
|
2017-08-14 06:34:34 +00:00
|
|
|
(dotspacemacs-directory-snippets-dir
|
2017-08-28 02:44:18 +00:00
|
|
|
(when dotspacemacs-directory
|
|
|
|
(let ((snippet-dir (expand-file-name
|
|
|
|
"snippets"
|
|
|
|
dotspacemacs-directory)))
|
|
|
|
(when (file-accessible-directory-p snippet-dir)
|
|
|
|
snippet-dir)))))
|
2016-01-09 02:56:49 +00:00
|
|
|
(setq yas-snippet-dirs nil)
|
|
|
|
;; ~/.emacs.d/layers/auto-completion/snippets
|
2018-01-15 04:28:28 +00:00
|
|
|
(add-to-list 'yas-snippet-dirs spacemacs-layer-snippets-dir)
|
2016-11-11 12:12:09 +00:00
|
|
|
;; ~/.emacs.d/private/snippets
|
2018-01-15 04:28:28 +00:00
|
|
|
(add-to-list 'yas-snippet-dirs emacs-directory-snippets-dir)
|
2016-01-09 02:56:49 +00:00
|
|
|
;; ~/.spacemacs.d/snippets
|
|
|
|
(when dotspacemacs-directory-snippets-dir
|
2018-01-15 04:28:28 +00:00
|
|
|
(add-to-list 'yas-snippet-dirs dotspacemacs-directory-snippets-dir))
|
2016-01-09 02:56:49 +00:00
|
|
|
;; arbitrary directories in `auto-completion-private-snippets-directory'
|
2016-11-11 12:12:09 +00:00
|
|
|
(when auto-completion-private-snippets-directory
|
|
|
|
(if (listp auto-completion-private-snippets-directory)
|
|
|
|
(setq yas-snippet-dirs (append yas-snippet-dirs auto-completion-private-snippets-directory))
|
2018-01-15 04:28:28 +00:00
|
|
|
(add-to-list 'yas-snippet-dirs auto-completion-private-snippets-directory))))
|
2015-04-23 02:03:04 +00:00
|
|
|
(spacemacs|add-toggle yasnippet
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode yas-minor-mode
|
2015-08-27 06:58:05 +00:00
|
|
|
:documentation "Enable snippets."
|
2015-07-25 13:14:53 +00:00
|
|
|
:evil-leader "ty")
|
2016-01-07 05:14:32 +00:00
|
|
|
(spacemacs/add-to-hooks
|
|
|
|
'spacemacs/force-yasnippet-off '(term-mode-hook
|
|
|
|
shell-mode-hook
|
2018-03-31 06:10:02 +00:00
|
|
|
eshell-mode-hook))
|
|
|
|
(spacemacs|require 'yasnippet)
|
|
|
|
(spacemacs/add-to-hooks 'spacemacs/load-yasnippet '(prog-mode-hook
|
|
|
|
markdown-mode-hook
|
|
|
|
org-mode-hook))
|
|
|
|
)
|
2015-12-03 15:33:03 +00:00
|
|
|
:config (spacemacs|diminish yas-minor-mode " ⓨ" " y")))
|
2015-05-13 07:33:55 +00:00
|
|
|
|
2018-01-15 04:24:48 +00:00
|
|
|
(defun auto-completion/init-yasnippet-snippets ())
|