Vim 中使用 OmniComplete 为 C/C++ 自动补全
来源:互联网 发布:路由器网络模式选哪个 编辑:程序博客网 时间:2024/04/29 03:14
(1) 解压 omnicppcomplete-0.41.zip 到目录 ~/.vim (unix) 或者 %HOMEPATH%\vimfiles (windows)
(2) 编辑 ~/.vimrc,增加如下内容
" ===== Set omnicppcomplete <C-X><C-O>, can get the option =====
" enable plugins
set nocp
filetype plugin on
" --c++-kinds=+p : Adds prototypes in the database for C/C++ files.
" --fields=+iaS : Adds inheritance (i), access (a) and function signatures (S) information.
" --extra=+q : Adds context to the tag name. Note: Without this option, the script cannot get class members.
" --languages=c++ : Builds only the tags for C++ files.
" ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --languages=c++ .
" add a map <C-F12>
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --languages=c++ .<CR>
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_DisplayMode = 1
let OmniCpp_ShowScopeInAbbr = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " 显示函数参数列表
let OmniCpp_MayCompleteDot = 1 " 输入 . 后自动补全
let OmniCpp_MayCompleteArrow = 1 " 输入 -> 后自动补全
let OmniCpp_MayCompleteScope = 1 " 输入 :: 后自动补全
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
let OmniCpp_SelectFirstItem = 1
set completeopt=longest,menu
(3) 使用vim打开C++文档中只需要操作 <C-F12> 就可以自动创建并更新 tags 了
附注:
omnicppcomplete-0.41.zip
下载地址:http://www.vim.org/scripts/script.php?script_id=1520
1 0
- Vim 中使用 OmniComplete 为 C/C++ 自动补全
- Vim 中使用 OmniComplete 为 C/C++ 自动补全
- Vim 中使用 OmniComplete 为 C/C++ 自动补全
- Vim 中使用 OmniComplete 为 C/C++ 自动补全
- Vim 中使用 OmniComplete 为 C/C++ 自动补全
- emacs下C/C++自动补全 之 使用Yasnippet模板补全 以自定义USACO模板为例
- Vim中C/C++代码补全插件-omnicppcomplete
- Vim中C/C++代码补全插件-omnicppcomplete
- Vim中C/C++代码补全插件-omnicppcomplete
- Vim 中实现括号自动补全
- vim 编辑器中 c++自动补全
- Vim中Python自动补全
- vim中php自动补全
- vim中自动补全的快捷键
- vi/vim使用进阶: 自动补全
- 使用Vim打造IDE--自动补全
- vi/vim使用进阶: 自动补全
- vim自动补全
- activity 通过Intent开启另一个activity无效
- Linux 内核设备驱动之GPIO驱动之GPIO GPIO描述符到GPIO号
- CentOS相关文献整理
- Smart-image通过SoftReference提高性能
- js 运动相关属性
- Vim 中使用 OmniComplete 为 C/C++ 自动补全
- 玩转数组之合并数组(处理重复数据)
- oracle学习-day02
- CSDN中的markdown基本语法总结
- Java —— 类的继承
- 51串口通信C封装
- Linux 内核设备驱动之GPIO驱动之GPIO GPIO描述符到GPIO CHIP
- 《C# 并发编程 · 经典实例》读书笔记
- javascript作用域和闭包之我见