Learn From
Environment
- ubuntu 19.04
- Spacemacs 0.200.13@26.3
- Emacs 26.3
Aim
Backup the way how to install tabnine in spacemacs. Only use the following content when the above link is not available.
Steps
We would like to use tabnine as a back-end service provider. auto-completion is the front-end. We will do the following setting auto-completion -> company -> company-tabnine.
Create tabnine layer
- In spacemacs, type SPC SPC
- configuration-layer/create-layer
- Asking for Configuration layer path, use default path ~/.emacs.d/private/
- Asking for Configuration layer name, type tabnine
- Asking for Create readme? (y or n), type n
Inside ~/.emacs.d/private/tabnine/package.el
(defconst tabnine-packages '(company-tabnine) ) ;;; initial company-tabnine library (defun tabnine/init-company-tabnine() (use-package company-tabnine :ensure t :defer t :init :config) ) ;;; use company-tabnine as company backend (defun tabnine/post-init-company-tabnine() (with-eval-after-load 'company (add-to-list 'company-backends #'company-tabnine) ) )
Add tabnine layer inside ~/.spacemacs
;; List of configuration layers to load. dotspacemacs-configuration-layers '( auto-completion better-defaults version-control emacs-lisp git ivy tabnine )
Final step
- Restart spacemacs
- You may need to install tabnine binary, SPC SPC, company-tabnine-install-binary
- Try it out or enable the layer by SPC SPC, company-mode
- notice: Company mode enabled in current buffer
沒有留言:
發佈留言