vim omnicppcomplete pattern not found(找不到 vim omnicppcomplete 模式)
问题描述
我在我的电脑上安装了 vim7.3(在 Windows 7 下)并且我想使用一个自动完成插件.
I installed vim7.3 on my computer (under windows 7) and i want to use an autocomplete plugin.
我搜索了很多,发现 Omnicppcomplete 是最好的.
I searched a lot and found that Omnicppcomplete is the best for that.
所以我跟着这个教程:安装 OmniCppComplete 插件
So i followed this tutorial: Install OmniCppComplete plugin
我的 _vimrc 配置文件如下所示:
My _vimrc config file looks like this:
set nocp
filetype plugin on
syntax on
set filetype=cpp
set tags+=C:/Program Files/Vim/vimfiles/tags/stl
" build tags of your own project with CTRL+F12
"map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
noremap <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<cr>
inoremap <F12> <Esc>:!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<cr>
" OmniCppComplete
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_MayCompleteDot = 1
let OmniCpp_MayCompleteArrow = 1
let OmniCpp_MayCompleteScope = 1
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
" automatically open and close the popup menu / preview window
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest,preview
但是如果我输入这个会出现错误并且不知道为什么.
But if i type this an error occurs and dont know why.
#include <iostream>
int main(void) {
std::|
}
和错误:-- Omni completion (^O^N^P) Pattern not found
还有这个 bugfix 没有帮助,因为我已经使用了使用 namespace std {}
and this bugfix not helps because i already use files which uses namespace std {}
推荐答案
问题是 set tags+=C:/Program Files/Vim/vimfiles/tags/stl
有问题这里:
the problem was that the set tags+=C:/Program Files/Vim/vimfiles/tags/stl
there is something wrong here:
:pwd
->c:Windowssystem32
- 将标签文件复制到 system32
- 重启vim
然后下面的 C++ 代码起作用了.
then the following c++ code worked.
这篇关于找不到 vim omnicppcomplete 模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:找不到 vim omnicppcomplete 模式


基础教程推荐
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09