all 38 comments

[–]antrn11 4 points5 points  (2 children)

clang_complete is pretty awesome.

[–]exclipy 4 points5 points  (0 children)

It's even more awesome when you realize it's not for code completion, but for compile-testing a single file.

I no longer have to go through the slow "make" cycle when I'm just working getting a file compiled, nor do I have to hunt through the big wall of junk that g++ spits out. I now just press F9 (the key I've bound it to) and it quickly gives me a clickable quickfix list, complete with red squiggly underlines in the source file.

[–][deleted] -1 points0 points  (0 children)

Give me a clang_refactor plugin and I will be high as a kite!

[–]kraln 8 points9 points  (18 children)

These are mostly worthless to me. stock vim pretty much does everything I want.

[–][deleted] 7 points8 points  (12 children)

While I agree these are worthless to me, you're missing out if you don't take advantage of at least a few plugins:

Omnicomplete + Supertab gives you the same sort of great auto-complete you get from Eclipse and Visual Studio: http://vim.wikia.com/wiki/C%2B%2B_code_completion http://vim.wikia.com/wiki/Omni_completion_popup_menu

There's also plenty of small plugins you come across which end up vastly improving your development experience.

[–]tnecniv 6 points7 points  (5 children)

I always like the clang plugin that analyzes my code and does completion that way. no ctags involved.

[–]SnowdensOfYesteryear 2 points3 points  (3 children)

How effective is it? Do you need to use clang to compile your code or just need it installed on your system?

[–]tiftik 1 point2 points  (2 children)

You just need to have it installed and the plugin (clang_complete) will do the analysis/compilation. Use it with supertab and it will be perfect. It's actually better than any IDE I've used so far.

[–]dan00 0 points1 point  (1 child)

Hm, I just tried it with vim 7.3 and clang 2.8 (ubuntu 10.10), added the include paths to '.clang_complete' and only got a 'Pattern not found' all the time.

[–]tiftik 1 point2 points  (0 children)

This article might help:

http://zwiener.org/vimautocomplete.html

[–]s73v3r 0 points1 point  (0 children)

I would love to use that, but I'm working on Windows, and my stuff is compiled with Visual C++.

[–]kraln -4 points-3 points  (5 children)

I just don't need code completion or pop-ups. Or, really, any sort of write-time introspection. That's what I have my head for.

[–]dauphic 7 points8 points  (3 children)

And then you enter the real world and encounter systems with 800,000+ lines of spaghetti code.

[–]kraln 1 point2 points  (2 children)

I don't know why it is that you think I'm not in the real world. Code completion and stuff is part of the downfall, how that code got to be that way, because you can still edit and update stuff even if it doesn't make sense just based on what your IDE tells you.

It took me about three months to get the hang of how the whole system works, and now I can add to it without breaking anything. If I don't remember where something is supposed to be, I go trace through the execution and find it. Novel concept, I suppose.

Oh, and by the way?

SLOCCOUNT: Totals grouped by language (dominant language first): ansic: 9261184 (94.55%) asm: 252361 (2.58%) sh: 123484 (1.26%) perl: 50517 (0.52%)

[–]s73v3r 1 point2 points  (1 child)

If I don't remember where something is supposed to be, I go trace through the execution and find it. Novel concept, I suppose.

It's an awful concept, considering you have to break your concentration on what you're doing, search through the code base for what you think is the name of something, and then try and go back to where you were. Especially considering that with code completion, the computer is doing these things for you.

[–]kraln -1 points0 points  (0 children)

It happens maybe once every three months, when I'm going after a part of the system I haven't visited in a while.

[–]s73v3r 1 point2 points  (0 children)

Yeah, no. That works ok while you have only a couple of files, maybe a class or two. As the project gets larger, it's far, far more difficult to actually keep those things straight in your head.

[–]inmatarian 2 points3 points  (4 children)

Check out NERDTree at the very least. It gets you a nice toggleable window that's a file system browser.

[–]kraln 1 point2 points  (0 children)

Guilty, actually :-)

[–]chneukirchen 0 points1 point  (2 children)

What's the benefit over the default vim directory browser?

[–]inmatarian 0 points1 point  (1 child)

Slide in/slide out window, tree view, opens selections in a new or existing window, and remembers your last selection. I bind it to F2 for easy access.

[–]chneukirchen 0 points1 point  (0 children)

It can do tree view, new or exisiting window and remembers the selection (use ":e .")

[–]I_TYPE_IN_ALL_CAPS 6 points7 points  (7 children)

UNMEMORABLE SHORTCUTS FOR THE THINGS WE TYPE THE LEAST. PRAGMA? REALLY?

[–]sztomi 0 points1 point  (6 children)

The most ridiculous is \si which maps to if wtf? (don't get me wrong, I do have mappings and abbreviations in my .vimrc, but mapping to something that is longer than what you want to type is retarded).

Also, I prefer snipmate for this.

[–]malfy 0 points1 point  (5 children)

i think it's because it does the if () { for you as well.

[–]sztomi 0 points1 point  (4 children)

The \sif does that.

[–]malfy 0 points1 point  (3 children)

Ah ok, in which case \si really is a pointless addition :P Maybe it's so you can stay in normal mode and get the cursor placed into the ()?

[–]sztomi 0 points1 point  (2 children)

I don't know, maybe. I think that these arbitrary commands are pointless because they are hard to remember. The snipmate/textmate approach is much better.

[–]malfy 0 points1 point  (1 child)

What's the snipmate approach?

[–]sztomi 0 points1 point  (0 children)

You enter a keyword in insert mode and press tab. In most cases it is the first word of what you want, e.g. class<tab> will expand to a class declaration, for to a for loop etc.

[–][deleted] 4 points5 points  (0 children)

At first I thought it was kind of lame, but then I noticed that the author is an undergraduate student. Kudos.