为 C++ 配置 Vim [英] Configuring Vim for C++

查看:32
本文介绍了为 C++ 配置 Vim的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让 vim 成为我的 C++ 编辑器.我几乎没有使用它的经验并且在配置 vim 以使用 C++ 方面需要帮助.我需要诸如

I would like to make vim my C++ editor. I have very little experience working with it and need help in configuring vim to work with C++. I need such features as

  • 代码完整(适用于 stl 和我的课程)
  • 在 .cc 和 .h 文件之间切换
  • C++ 和 vim 大师可能还有更多技巧.

也许你可以提供一些配置(带解释),或者教程链接,我可以使用的插件?

May be you could provide some configs (with explanations), or links to tutorials, plugins I could make use of?

推荐答案

  • 代码完成:Omni完成Clang 自动完成YouCompleteMe
  • 实时语法检查:Syntastic
  • 在源文件和头文件之间切换:一个插件
  • 代码片段:SnipmateUltiSnip
  • 搜索变量、函数、类等的引用:Cscope
  • 转到定义:CtagsYouCompleteMe 子命令 上面提到的
  • 重构工具:重构lh-refactor
  • 有用的文本对象:Arg 文本对象类文本对象
  • Vim Tips wiki 中的 C++ 类别
  • Luc Hermitte 的 C/C++ 插件
  • 不是 C++ 特定的,但我也推荐 FuzzyFinderCommand-T 或 Unite 用于文件导航.使用其中的任何一个,您甚至不需要选项卡(不能针对 10 个以上的文件进行缩放)来管理您的项目.
  • 类导航:Taglist标签栏
    • Code complete: Omni completion or Clang autocomplete or YouCompleteMe
    • Real time syntax checking: Syntastic
    • Switching between source and header file: A plugin
    • Snippets: Snipmate or UltiSnip
    • Search for reference of variables, functions, classes, etc.: Cscope
    • Go to definition: Ctags or part of YouCompleteMe subcommands mentioned above
    • Refactoring tools: Refactor, lh-refactor
    • Useful text objects: Arg text object and Class text object
    • C++ category in Vim Tips wiki
    • Luc Hermitte's C/C++ plugin
    • Not C++ specific but I also recommend either FuzzyFinder or Command-T or Unite for file navigation. With either of these, you don't even need tabs (which does not scale for 10+ files) to manage your project.
    • Class navigation: Taglist or Tagbar
    • 截至 2013 年 7 月更新

      Updated as of July 2013

      这篇关于为 C++ 配置 Vim的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆