为 C++ 配置 Vim

2023-06-29C/C++开发问题
19

本文介绍了为 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
  • 在源文件和头文件之间切换:一个插件
  • 代码片段:Snipmate 或 UltiSnip
  • 搜索变量、函数、类等的引用:Cscope
  • 转到定义:Ctags 或 YouCompleteMe 子命令 上面提到的
  • 重构工具:重构、lh-refactor
  • 有用的文本对象:Arg 文本对象 和 类文本对象
  • Vim Tips wiki 中的 C++ 类别
  • Luc Hermitte 的 C/C++ 插件
  • 不是 C++ 特定的,但我也推荐 FuzzyFinder 或 Command-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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

      The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6