我的自动补全有问题。我如何在打字时得到代码建议?
我通常用PHP, Ruby, HTML, C和CSS开发。
我的自动补全有问题。我如何在打字时得到代码建议?
我通常用PHP, Ruby, HTML, C和CSS开发。
当前回答
我已经使用neocomplcache大约半年了。它是一个插件,在你所有的缓冲区中收集单词缓存,然后为你提供它们来自动补全。
在前面的链接中,项目页面上有一组截图。Neocomplcache还有大量的配置选项,在项目页面上也有基本的示例。
如果您需要更深入的内容,您可以在我的vimrc中查看相关部分-只需搜索单词neocomplcache。
其他回答
您可以从内置的omniunc设置开始。
把:
filetype plugin on
au FileType php setl ofu=phpcomplete#CompletePHP
au FileType ruby,eruby setl ofu=rubycomplete#Complete
au FileType html,xhtml setl ofu=htmlcomplete#CompleteTags
au FileType c setl ofu=ccomplete#CompleteCpp
au FileType css setl ofu=csscomplete#CompleteCSS
在你的。vimrc底部,然后在插入模式下键入<Ctrl-X><Ctrl-O>。
我总是依赖这个CSS完成。
I recently discovered a project called OniVim, which is an electron-based front-end for NeoVim that comes with very nice autocomplete for several languages out of the box, and since it's basically just a wrapper around NeoVim, you have the full power of vim at your disposal if the GUI doesn't meet your needs. It's still in early development, but it is rapidly improving and there is a really active community around it. I have been using vim for over 10 years and started giving Oni a test drive a few weeks ago, and while it does have some bugs here and there it hasn't gotten in my way. I would strongly recommend it to new vim users who are still getting their vim-fingers!
OniVim: https://www.onivim.io/
另一个选项是coc.nvim。
它真的很快,补全很棒,因为它使用了与VScode相同的自动补全功能。 它还具有检测功能。这说明你可能有bug。 它支持多种语言。
它可能需要一些设置和配置,但我认为它是vim最好的自动补全引擎。
我已经使用neocomplcache大约半年了。它是一个插件,在你所有的缓冲区中收集单词缓存,然后为你提供它们来自动补全。
在前面的链接中,项目页面上有一组截图。Neocomplcache还有大量的配置选项,在项目页面上也有基本的示例。
如果您需要更深入的内容,您可以在我的vimrc中查看相关部分-只需搜索单词neocomplcache。
这里是链接!PHP。
在编写一些PHP函数时按下Ctrl + x和Ctrl + o键。
感谢Oseems Solutions提供的教程