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

查看:107
本文介绍了为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?

推荐答案


  • 代码完成:欧姆尼完成 C语自动填充 YouCompleteMe

  • 实时语法检查:语法

  • 在源文件和头文件之间切换:插件

  • 代码段s: Snipmate UltiSnip

  • 搜索变量,函数,类等的引用:< a href = http://cscope.sourceforge.net/cscope_vim_tutorial.html rel = noreferrer> Cscope

  • 转到定义: Ctags 上面提到的YouCompleteMe子命令

  • 重构工具:重构 lh重构

  • 有用的文本对象: Arg文本对象和< href = http:// www.reddit.com/r/vim/comments/e99h9/is_there_a_way_to_change_the_way_and_move/c16duif rel = noreferrer>类文本对象

  • Vim提示Wiki中的C ++类别

  • Luc Hermitte的C / C ++插件

  • 不是C ++专用的,但我也推荐 FuzzyFinder Command-T Unite 用于文件导航。无论使用哪种方法,您甚至都不需要标签(该标签不能扩展10个以上的文件)来管理您的项目。

  • 类导航:标记列表标签栏

    • 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天全站免登陆