Is it possible to toggle the autocompletion of nvim-cmp? Sometimes I’d prefer to have the autocompletion suppressed and just use C-X C-O, but other times, like when exploring a new library/package, have full automatic support.
Right, but in a given session, I cannot toggle on and off the autocompletion?
opened 02:42AM - 29 Sep 21 UTC
closed 03:12AM - 29 Sep 21 UTC
### Documentation improvement request
#### Background:
Although, this kind o… f **smart** tools are generally useful and is better to be enabled all the time, in some odd occasion, we want to turn off a short period by calling a lua call via some key binding.
There may be already enough code to do this or not, I don't know. It was not easy one for me to figure out.
#### Requested content
I am asking additional help message in README.md (with optional feature addition if needed) to describe how to turn on and off. I don't have proposed text for nvim-cmp but what I proposed for nvim-autopairs may give some idea of the desirable content.
https://github.com/windwp/nvim-autopairs/pull/141/commits/1afc05a2ed84394e050f16ee58b8c11cc5df5c64
Here, nvim-autopairs has 3 key APIs to enable this.
- read status
- enable
- disable
Making complicated condition to turn off can become non-trivial. This approach offers a simple alternative way to avoid problematic situations.
#### An example of a problematic situation addressed by this proposed documentation improvement (FYI):
Suppose you are writing C code for an embedded USB device scanning keyboard switches, this nvim-cmp is very useful to get all the variable names etc.
But when you start writing a MACRO table describing how each key responds to input for each state of the device, we need to make such tables for many device states. Copy (yy->p) and overwrite (R) is one way. But Instead of using overwrite mode, use of many **CTRL-Y** with occasional typing in the insert mode accommodates careful line-by-line updates.
Currently, every time some cmp's snippet engine finds opportunity, it stops **CTRL-Y** with a POPUP window. Then I need to close the POPUP. This is quite annoying and I just want to turn off for that part of editing.
For this kind of needs, editing configuration file of nvim-cmp and restarting nvim is not desirable path.
You can check out the issue yourself once. It is a plugin with many users, so most questions have already been answered.
2 Likes
Indeed. Thank you very much.