company-tabnine icon indicating copy to clipboard operation
company-tabnine copied to clipboard

Can I toggle company-tabnine in company mode?

Open fu123456 opened this issue 3 years ago • 1 comments

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.

fu123456 avatar Apr 13 '21 12:04 fu123456

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)))

shouya avatar Jun 13 '21 02:06 shouya