company-tabnine
company-tabnine copied to clipboard
Can I toggle company-tabnine in company mode?
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.
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)))