All Questions
488
questions
265
votes
7
answers
129k
views
Autocompletion in Vim
In a nutshell, I'm searching for a working autocompletion feature for the Vim editor. I've argued before that Vim completely replaces an IDE under Linux and while that's certainly true, it lacks one ...
176
votes
9
answers
111k
views
Do you debug C++ code in Vim? How? [closed]
The question is to all you people, who use Vim to develop C++ applications.
There was a period in my life, which can be described as
'I hate Vim!!!'..'Vim is nice!'
However, having grown up mostly ...
148
votes
3
answers
105k
views
Configuring Vim for 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
code-complete (for stl and for my ...
77
votes
11
answers
66k
views
class & function names highlighting in Vim
I just recently set up my Vim environment from Textmate, after becoming addicted to its modal input.
However, syntax highlighting seems to be not so beautiful in Vim. I code in C++ and since the ...
65
votes
9
answers
19k
views
Is there a C++11 syntax file for vim?
In particular, the display of initialization lists is really bad:
vector<int> v({1,2,3});
will highlight the curly braces in red (denoting an error).
48
votes
5
answers
36k
views
Vim: Go to Beginning/End of Next Method
Is there native functionality in Vim that allows one to move the cursor to the beginning/end of the next method? I already know about [[, ]], [], and ][, but these don't cut the job, because they only ...
36
votes
5
answers
8k
views
How to avoid namespace content indentation in vim?
How to set vim to not indent namespace content in C++?
namespace < identifier >
{
< statement_list > // Unwanted indentation
}
Surprisingly, 'cinoptions' doesn't provide a way to ...
31
votes
6
answers
27k
views
Vim [compile and] run shortcut
Basically what I want is a keyboard shortcut in vim that lets me [compile and] run the currently being edited C, C++ or Python program. In psuedocode:
when a shortcut key is pressed:
if ...
31
votes
3
answers
28k
views
How can I automatically generate / update header files from cpp files without using an IDE?
I am using VIM for C++ development for quite some years now and I don't want to debate the question whether to use an IDE or powerful text editor for software development. Up to now I've been involved ...
30
votes
6
answers
8k
views
looking up c++ documentation inside of vim
I code c++, using vim.
Often times, I find myself wasting time (and brekaing flow) looking up trivial things like:
is std::string.substring does it take (start, length) or (start, end).
This often ...
29
votes
3
answers
52k
views
How to enable intellisense in VIM (gvim)
Is there any way I can have intellisense enabled in VIM (gvim).
I wish to use it for STL.
25
votes
2
answers
11k
views
vim omnicomplete vs. vim intellisense
Are Vim OmniComplete and Vim Intellisense mutually exclusive or complementary? I'm a bit confused by conflicting terminology and implementations, such as these C++ OmniComplete and C++ Intellisence ...
25
votes
2
answers
24k
views
How do you get Vim to highlight C++ syntax errors like Visual Studio?
Is it possible to get gVim to highlight C++ syntax errors (the red squiggles underneath) in real-time like Visual Studio?
25
votes
2
answers
3k
views
How to enable completion of C++ template classes in vim using YouCompleteMe
When using the vim plugin YouCompleteMe for C++ code completion I stumbled over an issue.
Using nested template classes stops the completion to work properly.
Consider the following example to ...
25
votes
4
answers
2k
views
ctags ignore lists for libc6, libstdc++ and boost
I use ctags with vim and the OmniCppComplete plugin. Currently when generating my tags I do it individually for each library. For libc6 I use the following list of tokens / macros in a file named ...
24
votes
5
answers
48k
views
Vim YouCompleteMe configuration
i just installed YouCompleteMe for Vim through vundle. It works, but it shows only the words contained in the current file. I want to use it to develop c++ programs, how can i configure it to show ...
24
votes
4
answers
22k
views
gdb front end to use with vim? [duplicate]
What gdb frontends can I use with vim for debugging C and C++ code? Currently I use cgdb and am satisfied with it. Was just wondering what else is out there?
22
votes
4
answers
7k
views
Generating a reasonable ctags database for Boost
I'm running Ubuntu 8.04 and I ran the command:
$ ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f ~/.vim/tags/stdlibcpp /usr/include/c++/4.2.4/
to generate a ctags database for the standard C++ ...
21
votes
2
answers
15k
views
Including header files recursively for syntastic
I'm working with a C++ project and trying to configure it to use syntastic. In my project I have a nested directory structure of header files (The actual nested structure is much worse, this is an ...
21
votes
2
answers
2k
views
Vim different textwidth for multiline C comments?
In our C++ code base we keep 99 column lines but 79-some-odd column multiline comments. Is there a good strategy to do this automagically? I assume the modes are already known because of smart comment ...
20
votes
6
answers
7k
views
Go to the end of the C++ function in Vim
If I am in the middle of the function, I would like go to the very end of it in vim. I run into this problem as we sometimes have function of 500+ lines long (don't ask why).
I use vim, gvim.
20
votes
2
answers
2k
views
Turn off vim syntax highlighting inside C++ comments
I recently downloaded vim 8.0. I don't know if I messed something up or a default changed, but in this code...
int foo()
{
// This is a comment containing a "string" and the number 5.
return ...
19
votes
7
answers
15k
views
how to move to the next enclosing brackets in VI
Are there any shortcuts to move to the next enclosing brackets. For ex:
int func()
{
if(true)
{//this point
for(int i=0;i<10;i++)
{//need to jump from here to
//blah blah blah
}
...
19
votes
3
answers
15k
views
Can I make vim do syntax highlighting on C++ headers that don't have extensions?
I have a project with a bunch of C++ header files that follow the standard C++ header naming convention; that is, a class called Foo would be declared in a file called Foo, not Foo.h or Foo.hh. Is ...
19
votes
1
answer
1k
views
How do I let vim wrap triple-slash comments?
I often use gq to wrap longer comments to within some number of characters, which works fine if I am using // or /* /* to comment my code:
// here is a simple comment that exceeds my line width
// ...
18
votes
3
answers
12k
views
Can i go to the error after executing make in VIM?
Can i go to the line of error , while compiling a C or C++ project ? Usually by executing make , and parse the error string , and go to the specific file , and the line with errors.
Is there already ...
18
votes
4
answers
3k
views
vim, ctags, and identically named identifiers
vim + ctags works well for C projects, since C does not allow function overloading and, in general encourages manual prefixing of symbols due to rudimentary scoping facilities.
In C++, functions are ...
18
votes
6
answers
11k
views
C++ vim IDE. Things you'd need from it
I was going to create the C++ IDE Vim extendable plugin. It is not a problem to make one which will satisfy my own needs.
This plugin was going to work with workspaces, projects and its dependencies.
...
18
votes
1
answer
3k
views
Avoiding label indenting in C++
I guess this was asked before, but I could not find any similar question.
When writing part of the scope operator in C++, Vim guesses that it's going to be a label (on the first :) and then indents ...
17
votes
4
answers
7k
views
Finding definitions/references to C++ class members in Vim
I'm using Vim for a C++ project that I've started working on and I've been spending a lot of time lately browsing through the existing code to get a hang of it. To make the browsing easier, I've setup ...
16
votes
6
answers
38k
views
compile directly from vim
I'd like to compile cpp file w/o turning off vi.
I know the :!g++ file.cpp but I prefer :make so I added this line in .vimrc file
au FileType C set makeprg=gcc\ %
au FileType Cpp set makeprg=g++\ ...
15
votes
4
answers
25k
views
Easily comment (C++) code in vim
I have looked at the following question:
How to comment out a block of Python code in Vim
But that does not seem to work for me. How do I comment code easily without resorting to plugins/scripts?
15
votes
4
answers
11k
views
Setting up vim as C++ IDE
I wish to setup vim as C++ IDE so I can do all work from it.
I'm using these plugins for vim:
Clang complete - accurate completion
nerdtree - browse files
snipmate - insert snippets
AutoComplPop - ...
14
votes
3
answers
22k
views
Using vim for coding with in a big C++ project
Is there any plugin for VIM that I can use to index an C++ project code base?
I would apreciate functionalities like being capable of specifing a class and and may be a method and see what file/line ...
14
votes
4
answers
16k
views
Using VIM for C++/Qt development w/ Autocomplete
At work, I mainly program in C++ and when it needs to be graphical/multi-threaded/network enabled use Qt. Our environment is windows and I currently program w/ a combination of Visual Studio(debuggin ...
13
votes
3
answers
68k
views
Compiling and Running a C++ Program with Vim [duplicate]
I know this sounds really dumb, but I've written a C++ code on Vim editor and for the life of me cannot figure out how to compile and run it. I know this is extremely simple but I've been awake for ...
13
votes
4
answers
47k
views
"error: stray '\XXX' in C++ program": Why does this happen?
I'm writing a little program in C++, and come across a strange error:
src/Makefile/Tool.cpp:42:3: error: stray ‘\302’ in program
src/Makefile/Tool.cpp:42:3: error: stray ‘\240’ in program
I'm writing ...
13
votes
4
answers
15k
views
path setting for c++ include headers for vim
My vim has path settings as shown below.
path=.,/usr/include,,
I think this is a default setting of 'path' I guess.
Because of this, g f opens c header files under the cursor.
But on C++ file C++ ...
12
votes
3
answers
8k
views
Vim, C++, YCM, and Syntastic include path problems
I feel that I have an awesome setup for C++ programming using Vim but I can't find a way to tell Vim, YCM, and Syntastic where to search for headers. It would be really annoying to have to manually ...
11
votes
2
answers
15k
views
cscope: How to use cscope to search for a symbol using command line?
All the cscope tutorials I found online talk about how to use the interactive mode of cscope to search for symbols in editors such as vim and emacs. But I think it should be possible to issue a ...
11
votes
3
answers
18k
views
Prepare vim environment to work with clang-format
Problem:
E319: Sorry, the command is not available in this version
Problem
When I run vim environment and try reformat code (CTRL+K) i get this warning on the screen
Environment:
System: Mac OS ...
11
votes
2
answers
494
views
Can you search or filter Vim completions?
I am using Vim 8.0 with Python3 and myint/ClangComplete for C/C++ completions. SDL_<tab> suggests every function and type from SDL. Is there any way to limit suggestions to SDL_EventType types, ...
11
votes
2
answers
2k
views
Vim + OmniCppComplete: Completing on Class Members which are STL containers
Completion on class members which are STL containers is failing.
Completion on local objects which are STL containers works fine.
For example, given the following files:
// foo.h
#include <...
10
votes
7
answers
11k
views
Vim code completion
Is it possible to make Vim complete the code for you, like in any other IDE (not just word searching, but members of classes, methods etc.)?
What are the best options / plugins available?
10
votes
4
answers
5k
views
clang-format not working under gVim
I installed clang-format-3.8 via apt-get.
Now I try to use it in gVim, but it is not working.
I checked and clang-format-3.8 exists in the folder /usr/share/vim/addons/syntax.
But when I enter :pyf /...
10
votes
8
answers
3k
views
Is Vim editor very smart?
I am programming in C++ or Java. So I want to use Vim editor, because it is very flexible. I have heard that I can configure the Vim editor to be able to go
from object to the definition
from ...
10
votes
1
answer
4k
views
scope vs ctags in terms of features
I am a big fan of ctags Hence I am wondering if I have cscope, will I benefit more there two programs. Seems like the latter has the same features as ctags, namely, facilitating the finding of ...
10
votes
2
answers
6k
views
Call Hierarchy Eclipse feature in Vim?
I am considering migrating from eclipse to vim for c++ development- I've recently "rediscovered" Vim, and finally went beyond the basics. I'm loving it, but there are still a few features that I use ...
10
votes
2
answers
4k
views
Vim: Highlight C++ variables using scope?
I would like to have C++ variables highlighted by scope. E.g. variables should have different coloring depending on file, class, global or local scope. Is it possible?
UPDATE: External helpers (e.g. ...
9
votes
16
answers
11k
views
Do you use VIM/Emacs/Terminals to develop C/C++? What kind of projects is this practical for?
For those who are using vim/emacs/terminals,etc (ie, not an IDE proper) what sort of projects are you working on? Are they big? Production? Are these the tools you use at work? Or mostly for smaller ...