我想让 vim 成为我的 C++ 编辑器。我对此的使用经验很少
并需要帮助配置 vim 以使用 C++。
我需要这样的功能
- 代码完整(对于 stl 和我的课程)
- 在 .cc 和 .h 文件之间切换
- 作为 C++ 和 Vim 大师,您可能还有更多技巧。
也许您可以提供一些配置(带解释),或我可以使用的教程、插件的链接?
- 代码完成:全方位完成 http://vim.wikia.com/wiki/VimTip1608 or Clang 自动完成 http://www.vim.org/scripts/script.php?script_id=3302 or 你使我完整 https://github.com/Valloric/YouCompleteMe
- 实时语法检查:合成的 https://github.com/scrooloose/syntastic
- 在源文件和头文件之间切换:A plugin http://www.vim.org/scripts/script.php?script_id=31
- 片段:Snipmate http://www.vim.org/scripts/script.php?script_id=2540 or UltiSnip http://www.vim.org/scripts/script.php?script_id=2715
- 搜索变量、函数、类等的引用:Cscope http://cscope.sourceforge.net/cscope_vim_tutorial.html
- 转到定义:Ctags http://ctags.sourceforge.net/或一部分YouCompleteMe 子命令 https://github.com/Valloric/YouCompleteMe#the-gotodefinitionelsedeclaration-subcommand上文提到的
- 重构工具:Refactor http://www.vim.org/scripts/script.php?script_id=2087, lh-重构 https://github.com/LucHermitte/vim-refactor
- 有用的文本对象:Arg 文本对象 http://www.vim.org/scripts//script.php?script_id=2699 and 类文本对象 http://www.reddit.com/r/vim/comments/e99h9/is_there_a_way_to_change_the_way_and_move/c16duif
- Vim Tips wiki 中的 C++ 类别 http://vim.wikia.com/wiki/Category:C%2B%2B
- Luc Hermitte 的 C/C++ 插件 https://github.com/LucHermitte/lh-cpp
- 不是 C++ 特有的,但我也推荐模糊查找器 http://www.vim.org/scripts/script.php?script_id=1984 or 命令-T http://www.vim.org/scripts/script.php?script_id=3025 or Unite https://github.com/Shougo/unite.vim用于文件导航。使用其中任何一个,您甚至不需要选项卡(无法扩展到 10 个以上文件)来管理您的项目。
- 班级导航:Taglist http://www.vim.org/scripts/script.php?script_id=273 or Tagbar http://www.vim.org/scripts/script.php?script_id=3465
编辑:截至 2013 年 7 月更新
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)