doomemacs/modules/completion/company/config.el

56 lines
2 KiB
EmacsLisp
Raw Normal View History

;;; completion/company/config.el -*- lexical-binding: t; -*-
2017-02-19 18:41:26 -05:00
(def-package! company
:commands (company-complete-common company-manual-begin company-grab-line)
:init
2017-02-19 18:41:26 -05:00
(setq company-idle-delay nil
company-tooltip-limit 14
2017-02-19 18:41:26 -05:00
company-dabbrev-downcase nil
company-dabbrev-ignore-case nil
company-dabbrev-code-other-buffers t
company-tooltip-align-annotations t
company-require-match 'never
company-global-modes
'(not comint-mode erc-mode message-mode help-mode gud-mode)
company-frontends
'(company-pseudo-tooltip-frontend
company-echo-metadata-frontend)
company-backends
'((:separate company-capf company-yasnippet))
company-transformers '(company-sort-by-occurrence))
:config
2017-02-20 20:43:22 -05:00
(global-company-mode +1))
2017-02-19 18:41:26 -05:00
(def-package! company
:when (featurep! +auto)
:defer 2
:after-call post-self-insert-hook
:config (setq company-idle-delay 0.2))
(def-package! company-box
:when (and EMACS26+ (featurep! +childframe))
:hook (company-mode . company-box-mode)
2017-02-20 20:43:22 -05:00
:config
(setq company-box-backends-colors nil
company-box-icons-elisp
(list (all-the-icons-material "functions" :face 'all-the-icons-purple)
(all-the-icons-material "check_circle" :face 'all-the-icons-blue)
(all-the-icons-material "stars" :face 'all-the-icons-yellow)
(all-the-icons-material "format_paint" :face 'all-the-icons-pink))
company-box-icons-unknown (all-the-icons-material "find_in_page" :face 'all-the-icons-silver)
company-box-icons-yasnippet (all-the-icons-material "short_text" :face 'all-the-icons-green)))
2017-02-20 20:43:22 -05:00
(def-package! company-dict
:defer t
:config
(defun +company|enable-project-dicts (mode &rest _)
2017-06-29 16:25:37 +02:00
"Enable per-project dictionaries."
(if (symbol-value mode)
2018-05-28 12:26:03 +02:00
(add-to-list 'company-dict-minor-mode-list mode nil #'eq)
(setq company-dict-minor-mode-list (delq mode company-dict-minor-mode-list))))
(add-hook 'doom-project-hook #'+company|enable-project-dicts))
2017-02-19 18:41:26 -05:00