Pages - Menu

標籤

AWS (1) bash (1) Boost (2) C (2) CMake (2) Concurrency_Programming (3) CPP (37) Database (2) DNS (1) Docker (4) Docker-Compose (1) ELK (1) emacs (4) gcp (1) gdrive (1) git (1) gitbash (2) gitlab (1) kvm (4) Linux (5) MT4 (4) MT5 (4) Multicast (2) MySQL (2) Nijatrader8 (1) OpenCV (1) Python (4) QT5 (1) R (1) rdp (3) screenshot (1) ssh (3) Tabnine (1) TCP (1) TensorFlow (1) Tools (12) Ubuntu_1904 (11) Ubuntu_20_04 (5) UDP (1) VS2010 (1) VS2015 (1) VS2019 (1) WebServer (1) Win10 (1) winmerge (1) WSL (1) xrdp (1)

搜尋此網誌

2020年3月21日星期六

Tabnine in spacemacs

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

  1. In spacemacs, type SPC SPC
  2. configuration-layer/create-layer
  3. Asking for Configuration layer path, use default path ~/.emacs.d/private/
  4. Asking for Configuration layer name, type tabnine
  5. 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

  1. Restart spacemacs
  2. You may need to install tabnine binary, SPC SPC, company-tabnine-install-binary
  3. Try it out or enable the layer by SPC SPC, company-mode
    1. notice: Company mode enabled in current buffer

沒有留言:

發佈留言