Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Dicky B
Mar 23, 2004

DreadCthulhu posted:

  • ctrlp - I can't live without this any longer. Fuzzy searching is amazing and completely removes the need for any kind of folder navigation if your work is contained to one folder.
I switched from Command-T to ctrlp for a while because I read somewhere that it's apparently faster, but whenever I try to use it in a large project it doesn't work properly and some files just don't show up at all.

Command-T is essentially the same but seems more robust in my experience, though you'll need to build vim with ruby support enabled.

Adbot
ADBOT LOVES YOU

Dicky B
Mar 23, 2004

DreadCthulhu posted:

I've had 0 problems with it in my experience, both as far as speed and functionality is concerned. I actually had the opposite experience with Command-T, it was super slow for me. Go figure.

With regards to files disappearing, watch out for newly added files to the folder tree, they don't automatically get added to the cache. Press F5 from within the ctrlp buffer to refresh the cache.
Yea I'm aware of that, and I also had zero problems using it in small-to-medium sized projects, but I've found it gets increasingly unreliable the more files there are in the tree. It certainly seemed a little faster but unfortunately it just didn't work :(

More plugins!
clang-complete - Intellisense for C, C++ and Objective-C!
YouCompleteMe - An alternative to the above which I haven't tried.

Dicky B
Mar 23, 2004

Sailor_Spoon posted:

Turning off the cache is not as awful as it sounds. For me, a "large" project is around 100k LOC, maybe 500 source files or so, but even on a normal hard drive, the performance impact is barely noticable.
I didn't try just disabling the cache entirely; perhaps that might help. I'll give it a try at work tomorrow.

Dicky B
Mar 23, 2004

Keebler posted:

I've been using VIM for coding for a while now, my only complaint over using an IDE is that I don't have a nice visual debugger available to use. Does anything like the MSVC debugger exist that might run in this environment? I tend to use C/C++.
Which platform? On Linux I use cgdb.

Dicky B
Mar 23, 2004

facepalmolive posted:

The one thing I miss most about IDEs is finding all references to a variable. ctags is great and all, but it only lets you find the declaration given a tag, and not the other way around -- i.e., I have a function named foo, now tell me all places where I call foo().

Is that what ctrlp does?
No, ctrlp is for locating files, but what you describe can be achieved through other means. I use ack.vim for exactly that purpose.

Dicky B
Mar 23, 2004

I mentioned YouCompleteMe earlier in the thread as an alternative to clang-complete. I set up a new development machine today and decided to give it a whirl and it's really nice. It provides auto-completion for basically any language and optional semantic completion for various languages provided you have the appropriate tools installed. It also integrates with Syntastic which automatically highlights errors and warnings.

Syntastic itself actually seems to work better than Visual Studio's C/C++ intellisense engine in most cases, though it doesn't seem to play nice if you're doing weird things with the C preprocessor.

Dicky B
Mar 23, 2004

I often use g, to jump back to the last edit point, but this doesn't work across buffers. Does anyone know if there is a way to make it work across buffers?

Dicky B
Mar 23, 2004

That does exactly the same as g, for me, and is still buffer-local :/

This seems to be the case with a completely bare .vimrc. Do you have anything in your config which changes this behaviour?

Dicky B
Mar 23, 2004

The latter. There doesn't seem to be any way to just switch to the last edited buffer either. I assume it's possible to implement this through vimscript though.

Dicky B
Mar 23, 2004

sm00th posted:

Ctrl+o jumps back, including across buffers
For my purposes this works fine. Thanks! :)

Dicky B
Mar 23, 2004

BufSurf is based on viewing history, not edit history.

If there's a way to switch to the last modified buffer then it would be trivial to set up a mapping to do what I want but this doesn't appear to be a core feature. Fortunately Ctrl-o is good enough for my particular needs.

Dicky B
Mar 23, 2004

What is the quickest way to tranform this:
C++ code:
void butt(int fart, int *goon, const int *autism)
into this:
C++ code:
void butt(
	int fart,
	int *goon,
	const int *autism)

Dicky B
Mar 23, 2004

Cool, I've ended up with :s/[(,]\s\?/\0\r\t/g which sorts the indentation out as well. Thanks for pointing me in the right direction!

Dicky B
Mar 23, 2004

clang-complete works in much the same way as YCM. I used it for a long time before switching to YCM.

Dicky B
Mar 23, 2004

You can use shift-k to look up the word under the cursor

Adbot
ADBOT LOVES YOU

Dicky B
Mar 23, 2004

tekz posted:

What plugins would you guys recommend for tab autocomplete,
YouCompleteMe

tekz posted:

closing html tags,
emmet.vim

tekz posted:

jumping to ends of blocks/methods/parentheses
%

tekz posted:

and search all files for text
I use the ack.vim plugin but :grep should work fine

  • Locked thread