-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-company.el
67 lines (58 loc) · 2.21 KB
/
init-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
64
65
66
67
;; Completion ignores filenames ending in any string in this list.
(setq completion-ignored-extensions
'(".o" ".elc" "~" ".bin" ".class" ".exe" ".ps" ".abs" ".mx"
".~jv" ".rbc" ".pyc" ".beam" ".aux" ".out" ".pdf" ".hbc"))
(use-package company
:diminish ""
:init
;; (add-hook 'prog-mode-hook 'company-mode)
;; (add-hook 'comint-mode-hook 'company-mode)
:config
(global-company-mode)
(setq company-tooltip-limit 10)
(setq company-idle-delay 0.2)
(setq company-echo-delay 0)
(setq company-minimum-prefix-length 3)
(setq company-require-match nil)
(setq company-selection-wrap-around t)
(setq company-tooltip-align-annotations t)
(setq company-tooltip-flip-when-above t)
(setq company-transformers '(company-sort-by-occurrence)) ; weight by frequency
(define-key company-active-map (kbd "M-n") nil)
(define-key company-active-map (kbd "M-p") nil)
(define-key company-active-map (kbd "C-n") 'company-select-next)
(define-key company-active-map (kbd "C-p") 'company-select-previous)
(define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle)
(define-key company-active-map (kbd "<tab>") 'company-complete-common-or-cycle)
(define-key company-active-map (kbd "S-TAB") 'company-select-previous)
(define-key company-active-map (kbd "<backtab>") 'company-select-previous)
;; Quick-help (popup documentation for suggestions).
;; (use-package company-quickhelp
;; :if window-system
;; :init (company-quickhelp-mode 1))
;; Company settings.
;; =======================
;; Adding company backends
;; =======================
;; Python auto completion
(use-package company-jedi
:init
(setq company-jedi-python-bin "python2")
:config
(add-to-list 'company-backends 'company-jedi))
;; HTML completion
(use-package company-web
:bind (("C-c w" . company-web-html))
:config
(add-to-list 'company-backends 'company-web-html))
(use-package company-statistics
:config
(add-hook 'after-init-hook 'company-statistics-mode))
;; (use-package company-ansible
;; :defer t
;; :config
;; (add-to-list 'company-backends 'company-ansible))
)
;;(company-quickhelp-mode 1)
(provide 'init-company)
;;; init-company.el ends here