TommyX12 / company-tabnine

A company-mode backend for TabNine, the all-language autocompleter: https://tabnine.com/
MIT License
686 stars 52 forks source link

Can I toggle company-tabnine in company mode? #51

Open fu123456 opened 3 years ago

fu123456 commented 3 years ago

Sometimes, when I use company-mode, but I want to close tabnine, since CPU and memory are high. So how to toggle tabnine in the company-mode? Very thanks.

shouya commented 3 years ago

I wrote two simple functions to manually turn on and off TabNine for the current buffer. It may be helpful for you.

(defun shou/tabnine-off ()
  "turn off TabNine for this buffer"
  (interactive)
  (setq-local company-backends (delete 'company-tabnine company-backends)))

(defun shou/tabnine-on ()
  "turn on TabNine for this buffer"
  (interactive)
  (setq-local company-backends (add-to-list 'company-backends 'company-tabnine)))