英文:
How to disable omnifunc autowrite suggestions
问题
我刚开始使用vim,今天我安装了vim-go插件。我使用gopls设置了自动补全,并将omnifunc设置为go#complete#Complete
。它按预期工作,但它总是自动写入当前的建议,这非常令人烦恼,因为它总是在我接受之前就写入了建议。
英文:
I am new to vim and I installed vim-go today. I set up auto completion with gopls with omnifunc set as go#complete#Complete
. It works as expected but it always writes the current suggestion automatically. this is very annoying since it always writes the suggestion without me accepting it.
答案1
得分: 1
原来问题是vim中completeopt
选项的默认值。将其编辑为noinsert
的值解决了问题。在~/.vimrc
文件中添加以下行:
set completeopt=menuone,popup,noinsert
上述只是一个示例,除了noinsert
之外的值只是我个人的偏好。
英文:
It turns out the problem was the default value of completeopt
option in vim. editing it to have the value noinsert
solved the problem. add the following line in ~/.vimrc<br><br>
set completeopt=menuone,popup,noinsert
<br><br>
The above is just an example. the values except noinsert
are just my own preferences.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论