-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtabnine.el
31 lines (24 loc) · 982 Bytes
/
tabnine.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
;;; tabnine.el --- setup tabnine completion for emacs
;;; commentary:
;;; code:
(use-package company-tabnine :ensure t)
;;(add-to-list 'company-backends #'company-tabnine)
;; Trigger completion immediately.
(setq company-idle-delay 0)
;; Number the candidates (use M-1, M-2 etc to select completions).
(setq company-show-numbers t)
;; workaround for company-transformers
(setq company-tabnine--disable-next-transform nil)
(defun my-company--transform-candidates (func &rest args)
(if (not company-tabnine--disable-next-transform)
(apply func args)
(setq company-tabnine--disable-next-transform nil)
(car args)))
(defun my-company-tabnine (func &rest args)
(when (eq (car args) 'candidates)
(setq company-tabnine--disable-next-transform t))
(apply func args))
(advice-add #'company--transform-candidates :around #'my-company--transform-candidates)
(advice-add #'company-tabnine :around #'my-company-tabnine)
(provide 'tabnine)
;;; tabnine.el ends here