summary refs log tree commit diff stats
path: root/user/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'user/emacs')
-rw-r--r--user/emacs/init.el27
1 files changed, 8 insertions, 19 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index d75b2025..480c411b 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -516,27 +516,16 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
   :defer t
   :config (setq all-the-icons-color-icons nil))
 
-(defmacro company-set-secondary-backend-for-mode (mode backend)
-  (let ((hook-fn-name (intern (concat "ap/set-local-backend-" (symbol-name mode)))))
-    `(progn
-       (defun ,hook-fn-name ()
-         (make-local-variable 'company-backends)
-         (setq company-backends (append
-                                 (list
-                                  'company-tabnine
-                                  ,backend)
-                                 (copy-tree (remq 'company-tabnine company-backends)))))
-       (add-hook ',(derived-mode-hook-name mode) #',hook-fn-name))))
-
-(use-package company-tabnine
-  :commands (company-tabnine)
+(use-package tabnine-capf
+  :commands (tabnine-completion-at-point)
   :after (company)
-  :config (setq company-tabnine-binaries-folder "~/.local/tabnine")
-  :general ("<M-tab>" #'company-tabnine-call-other-backends
-            "<C-tab>" #'company-tabnine-call-other-backends)
+  :config (setq tabnine-capf-binaries-folder "~/.local/tabnine")
+  ;; use tabnine-capf-with-disabled
+  :general ("<M-tab>" #'tabnine-capf-call-other-backends
+            "<C-tab>" #'tabnine-capf-call-other-backends)
   :init (progn
-          (advice-add 'company-tabnine-start-process :around #'quiet)
-          (add-to-list 'company-backends #'company-tabnine)))
+          (advice-add 'tabnine-capf-start-process :around #'quiet)
+          (add-to-list 'company-backends #'tabnine-completion-at-point)))
 
 ;;; Documentation