r/programming • • Sep 24 '15

Vim Creep

http://www.norfolkwinters.com/vim-creep/
1.2k Upvotes

844 comments sorted by

View all comments

15

u/OffbeatDrizzle Sep 24 '15

I don't understand how people can use vim to write code - intellisense is such a god send these days

55

u/LucHermitte Sep 24 '15

Intellisense like is available to vim as well. Check YouCompleteMe: https://github.com/Valloric/YouCompleteMe

8

u/-Nii- Sep 25 '15

And now omnisharp.

7

u/rlbond86 Sep 25 '15

This is just code completion. IntelliSense does that, but also much more. It can tell me where a particular method is called in my code base - even if there are other classes with methods that have the same name. IntelliSense actually understands your code, not just its identifiers.

4

u/LucHermitte Sep 25 '15

It's a little bit more that code completion. Its IntelliSense feature is based on clang, but restricted to the current translation unit in C and C++.

clang is bringing a revolution to "old" editors. Code indexing is now available (a little bit with YCM, with clang-indexer as well (to be used with vim-clang) ; and last year at cppcon14, a google guy spoke about another clang based code indexer that they should opensource, well I'm still waiting for it as its should work better than clang-indexer that I'm not really maintaining right now).
I won't be surprised to see eventually clang based refactoring tools that we'll able to plug to from vim and emacs.

→ More replies (2)
→ More replies (2)

2

u/original_brogrammer Sep 25 '15

Pair this up with UltiSnips and watch code appear as you think it.

1

u/dpash Sep 25 '15

Vim has had autocomplete support for about 10-15 years, but I think it was only based on a word list, so not as useful as it could have been. I presume YouCompleteMe is based on this functionality.

→ More replies (2)

8

u/MaikKlein Sep 24 '15

You can use vsvim

2

u/flukus Sep 25 '15

You can (and I do) but it's got nothing on the full vim engine.

8

u/codebje Sep 25 '15

I rely on intellisense for Java, not so much for Haskell. I think the language plays a large part in whether intellisense is useful.

As a contrast, in Java I find it a pain to manually import classes, often forgetting exactly where in the package hierarchy they are, so having IntelliJ do that for me is a god send. But in Haskell I usually only need a small number of imports, some generic ones like Monad, Applicative, List, and one or two for whatever libraries I might be using. That's easy to handle manually.

I don't depend so much on intellisense for Clojure hacking, either. Or JavaScript.

Come to think of it, I pretty much just use it for Java.

6

u/x-skeww Sep 25 '15

Well, of course you don't depend much on it for JavaScript because you can't depend on something which isn't there.

You have to use TypeScript or at least t.ds files for the libraries you're using in order to get decent tooling. You also need to use ES6 classes and modules.

With a jquery.d.ts file:

http://i.imgur.com/xn15B5c.gif

4

u/codebje Sep 25 '15

I am using IntelliSense as a proprietary eponym for the class of smart editing behaviours including autoformatting, code completion, documentation integration, and linting, rather than as the (I think) Visual Studio implementation of it.

And I can have all those things for JavaScript (I do use the linter part of it) but I don't miss not having them :-)

→ More replies (5)
→ More replies (4)

16

u/[deleted] Sep 24 '15

If nobody sees you programming, are you really programming?

4

u/memgrind Sep 24 '15

I daily help people navigate mere 2 million lines of code, with heavy #ifdef and macros. Vim users eventually manage (with all usable plugins installed) if the darn thing is grep-able. Utterly fail if the block is #ifdef and inactive for the build, and miss all references generated from macros. Users of other editors, which lack strong intellisense, effectively require babysitting through the whole process.

Still, vim is the first thing I install on a machine. Practically irreplaceable when I get to view 1GB log-files, especially remotely.

1

u/akmark Sep 25 '15

What tools are you using that unfuck #ifdef/macro silliness? I haven't really saw/used a tool that handled this well.

→ More replies (2)
→ More replies (1)

17

u/[deleted] Sep 25 '15

Intellisense is nothing special, it's just brand name for one of Microsoft's static analysis tool. Pretty much every compiler worth its salt provides the same functionality.

→ More replies (1)

3

u/crowseldon Sep 25 '15

even in IDEs, I'll use vim plugins for keybindings and other goodies.

The ability to stay on the home row is just the tip of the iceberg for these editors but is still absolutely awesome.

2

u/dccorona Sep 24 '15

Even ignoring that, which VIM can do-ish (I don't know that anything is truly as good as intellisense, and I say that as a guy who uses IntelliJ for the most part), there's plenty of really useful stuff a GUI IDE can offer that VIM just can't. Stuff like popping up documentation on hover, overlaying argument lists and overrides, showing hints for useful refactors inline, etc.

5

u/codygman Sep 25 '15

popping up documentation on hover, overlaying argument lists and overrides, showing hints for useful refactors inline

This can be done in either emacs or vim, but you have to know of the solutions or how to find them as well as how to configure them.

Another option that gives a lot of these (all for more popular languages I believe) for free with a sane configuration is Spacemacs.

1

u/guepier Sep 25 '15

All of this can be done in Vim (as in: there are high-quality plugins for it, no need to roll your own).

The only real difference between Vim and IDEs is that Vim is, well, ugly. I don’t mind the console look for the most part, but having no proper popover/hover/overlay boxes and instead having text output even for things that are patently not text is very annoying.

I use Vim exclusively and that’s the one thing I really miss.

→ More replies (8)

1

u/[deleted] Sep 25 '15

Yeah, intellisense also helps by showing type signatures. That is something the generic "works with any language" code completion engines (like the one for vim someone else posted) don't usually do.

1

u/dromtrund Sep 25 '15

Yeaah, I do embedded, and our toolchain feels like 1999. The ide just doesn't provide enough cool things to be worth it. We got autocomplete last year.

→ More replies (1)