-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmk_company.el
63 lines (45 loc) · 1.62 KB
/
mk_company.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
;;; mk_company.el --- Custom config for Emacs company mode.
;;; Commentary:
;;
;;; Code:
;; Enable `company-mode' in all buffers
(add-hook 'after-init-hook 'global-company-mode)
;; (setq company-global-modes '(emacs-lisp-mode python-mode))
;; company-box
(require 'company-box)
(add-hook 'company-mode-hook 'company-box-mode)
;; ================
;; company settings
;; ================
(setq company-minimum-prefix-length 1
company-tooltip-align-annotations t
company-files-exclusions '(".git/")
company-idle-delay 0.0)
;; (setq company-dabbrev-downcase nil) ;; Don't downcase completion candidates
;; ========
;; Backends
;; ========
;; Key var: `company-backends'.
;; Note that only one backend is used at a time, but a backend can be
;; grouped into a list. One neat feature about company is that you can
;; interactively call separate backends.
(require 'company-auctex)
;; Globally activate unicode symbol completion
;; NOTE: This backend is not active in latex math envs. For LaTeX, use
;; company-math-symbols-latex.
(add-to-list 'company-backends 'company-math-symbols-unicode)
(defvar backends-for-tex
'((company-math-symbols-latex ; from `company-math'
company-latex-commands)
(company-auctex-macros
company-auctex-symbols
company-auctex-environments)
(company-auctex-labels)
(company-auctex-bibs))
"Backends provided by `company-math' and `company-auctex'.")
(defun mk/enable-tex-backends()
"Enable `company-math' and `company-auctex' backends."
(setq-local company-backends
(append backends-for-tex company-backends)))
(provide 'mk_company)
;;; mk_company.el ends here