As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [filetype-c++]

Questions about of the file type cpp.

Filter by
Sorted by
Tagged with
11 votes
3 answers
4k views

How do I add skeleton text to new vim files?

I use Vim for writing C++, and I have quite a few #include<> statements, comments, etc. that I must include in each new file I create. I've added autocmd BufNewFile *.cpp r C:\(full file path ...
electriccello's user avatar
14 votes
5 answers
2k views

Quick search, limited to a C++ function

I work on a rather large C++ project. One of the more frustrating aspects of its organization is very large functions placed inside ridiculously large files. I often want to search for any instance ...
jkerian's user avatar
  • 333
11 votes
3 answers
2k views

Vim, ctags and overloading

Is there a way to make vim jump to the right matching definition automatically in case of multiple definitions. Our C++ code heavily uses function overloading and vim's handling of ctags does not ...
mesibo's user avatar
  • 210
8 votes
2 answers
4k views

Jumping to start/end of function definition in C++

Is there an easy way to jump to the beginning or end of the function your cursor is currently inside? It doesn't seem like sentence/paragraph/section have useful syntax aware meanings when editing C++....
eof's user avatar
  • 81
19 votes
4 answers
28k views

Can I jump to a function declaration or definition in a multiple C++ source files project?

Can I jump to a function declaration or definition in a multiple C++ source files project? Lets say I have a header file foo.hpp: int bar(); and a source file foo.cpp: #include "foo.hpp" int bar() ...
Allan Hasegawa's user avatar
5 votes
1 answer
927 views

Search and replace, but ignore text in quotes

As a poor-mans refactoring, I'd like to do a search and replace, but omit strings that are in double quotes (C/C++ quoting rules). For example cout << "Some variable " << variable <<...
jdm's user avatar
  • 151
5 votes
2 answers
792 views

Vim `cpp` Syntax highlighter prematurely ends macros mid-word

NOTE: This question is a "manual migration" from here: https://superuser.com/q/875751/199803 My Vim syntax highlighter for ft=cpp is prematurely ending some macros mid-line. For example: (The ...
Kyle Strand's user avatar
2 votes
1 answer
794 views

Understanding indenting rules for C++ files

Why is the following C++ source file indented like this, #include <vector> int main() { std::vector<std::vector<int>> v{ {1,2}, {1,1}, {1,2} };...
Enlico's user avatar
  • 2,054
2 votes
1 answer
138 views

How to change in gvim GTK file browser the default file mask wildcard (glob)?

In gvim the command :browse confirm e launches a GTK file browser. The default file mask in this window depends on the filetype from which the browse window is invoked. I would like to change that ...
Janek_Kozicki's user avatar