Live data from Hacker News

Turning vim into an IDE through vim plugins

safaribooksonline.com

31–40 of 63 posts

Re: Turning vim into an IDE through vim plugins

#31

Earlier quoted context omitted.

> Are there people who recently got into it and think it's the superior way to code and why? I started coding with Visual Studio, and then later Eclipse. I like both IDEs. I only learned about vi/vim about a year after I started programming, and it looked intimidating. 2 years after that, I decided, fuck it, let's see if I can do this. It took me one day to learn how to comfortably navigate with the hjkl keys, as wel…

> Most actions are blazingly fast compared to a gui text editor. e.g. To delete a whole line just press dd instead of home + shift + end + delete Ctrl + X works on most 'gui text editors' > There hasn't been one feature that and IDE has that I used, which can't be achieved in vim (or via a plugin) How does "find references" work in vim? If i want to find all usages of a method called "getName", does it know how to di…

Depends on the language. For C/C++ there is rtags, which compiles your code with clang and extracts type info, after which it can find all usages of said method on the exact class you're searching for. I personally use ctags and rtags together for code browsing, to alleviate problems one or the other has. Rtags can be a bit unstable and slow-ish, while ctags is just for definitions and somewhat of a dumb text search.

So far every C/C++ IDE I've seen on Linux has been incredibly dodgy, unstable, resource-hungry, etc. The text editor compoment is invariably light years behind vim and the actual "integrated" parts are of similar quality, so I continue using vim with enough plugins to get the job done. That doesn't really give you an IDE, it gives you a coding component of a Non-integrated Development Environment, where you build and test on the commandline by running commands and scripts, commit by running git, etc. I'm honestly perfectly fine with an NDE, as long as each component does its job reasonably well. I've tried various gdb integrations and they're so horrible, I just learned how to use vanilla gdb on the console. So yes, setting a breakpoint means copying the method name from vim and pasting it in gdb's commandline, but the important part is that it works and keeps working and doesn't set the breakpoint wrong, or crash, or put my editor in some weird state, or lose connection with the debugger (literally how??), etc. So I just use ol' reliable tools to get the job done without fuss.

About the only one that I've seen that actually works is QtCreator, but its license costs more than VisualStudio's, and it's definitely not worth the price (to me or my employer). CLion I've also heard good things about, but couldn't put through its paces enough before the trial period ran out.

Re: Turning vim into an IDE through vim plugins

#32

Earlier quoted context omitted.

> Are there people who recently got into it and think it's the superior way to code and why? I started coding with Visual Studio, and then later Eclipse. I like both IDEs. I only learned about vi/vim about a year after I started programming, and it looked intimidating. 2 years after that, I decided, fuck it, let's see if I can do this. It took me one day to learn how to comfortably navigate with the hjkl keys, as wel…

> Most actions are blazingly fast compared to a gui text editor. e.g. To delete a whole line just press dd instead of home + shift + end + delete Ctrl + X works on most 'gui text editors' > There hasn't been one feature that and IDE has that I used, which can't be achieved in vim (or via a plugin) How does "find references" work in vim? If i want to find all usages of a method called "getName", does it know how to di…

> Ctrl + X works on most 'gui text editors'

Really? Even if you haven't selected the line? Because if you haven't selected the line then you'll have to use your mouse first or do the home + shift + end + Ctrl + X to delete the line.

I remember Ctrl + D does this (without needing to select the line) in Eclipse. But it's still faster to type dd than Ctrl + D

> How does "find references" work in vim?

https://stackoverflow.com/a/9616315

Re: Turning vim into an IDE through vim plugins

#33
post #29

Earlier quoted context omitted.

> Are there people who recently got into it and think it's the superior way to code and why? I started coding with Visual Studio, and then later Eclipse. I like both IDEs. I only learned about vi/vim about a year after I started programming, and it looked intimidating. 2 years after that, I decided, fuck it, let's see if I can do this. It took me one day to learn how to comfortably navigate with the hjkl keys, as wel…

Have you found a plug-in that handlea autocompletion/find references/go to definition as well as SlickEdit or Eclipse? I tried ctags and a few others for autocompletion, etc. They were super complicated to install and use. Also they do not find references properly, having a bunch of misses or false positives. I like Vi style editing, but I found it better to use a real IDE and find a Vi plug-in for it.

There are a whole bunch of plugins for autocompletion (depends on the language you are using)

Find references : try [0] or [1]

go to definition (I haven't searched for this functionality, so I don't know if it exists)

[0] https://github.com/asenac/vim-opengrok [1] https://stackoverflow.com/a/9616315

Re: Turning vim into an IDE through vim plugins

#34
"NERDTree satisfies this need of mine, replacing vim’s built-in netrw file navigator with a nicer-looking, less buggy, more fully featured alternative."

Wait, what's wrong with the built-in netrw? I actually started with NERDTree before I knew netrw existed. After discovering netrw, I switched to it instead. I think it looks just fine and prefer it to the more complex NERDTree.

Re: Turning vim into an IDE through vim plugins

#35
I'm surprised the author didn't mention vim's sessions feature. The ability to close the editor/IDE and pick up right where you left off can save a lot of time when working with multiple large projects. It's easy enough to use on its own, but I have a small wrapper plugin that adds a few features for ease of use: https://github.com/bgrohman/vim-bg-sessions.

Re: Turning vim into an IDE through vim plugins

#36

I'm surprised the author didn't mention vim's sessions feature. The ability to close the editor/IDE and pick up right where you left off can save a lot of time when working with multiple large projects. It's easy enough to use on its own, but I have a small wrapper plugin that adds a few features for ease of use: https://github.com/bgrohman/vim-bg-sessions .

For which Tim Pope's Obsession plugin [0] is fantastic. It solved a whole bunch of weird conflicts that I had with plugins.

[0]: https://github.com/tpope/vim-obsession

Re: Turning vim into an IDE through vim plugins

#37

Earlier quoted context omitted.

> Most actions are blazingly fast compared to a gui text editor. e.g. To delete a whole line just press dd instead of home + shift + end + delete Ctrl + X works on most 'gui text editors' > There hasn't been one feature that and IDE has that I used, which can't be achieved in vim (or via a plugin) How does "find references" work in vim? If i want to find all usages of a method called "getName", does it know how to di…

> Ctrl + X works on most 'gui text editors' Really? Even if you haven't selected the line? Because if you haven't selected the line then you'll have to use your mouse first or do the home + shift + end + Ctrl + X to delete the line. I remember Ctrl + D does this (without needing to select the line) in Eclipse. But it's still faster to type dd than Ctrl + D > How does "find references" work in vim? https://stackoverfl…

> Really? Even if you haven't selected the line?

Yeah

Re: Turning vim into an IDE through vim plugins

#38
post #30
post #4

Earlier quoted context omitted.

That is the reason I chose neomake, because syntastic was dragging vim down. I'm curious, how does ALE compare to neomake?

Using ALE right now. By design: Syntastic runs synchronously on save, Neomake runs asynchronously on save, ALE runs asynchronously as you type. Neomake is good but I see no reason to go back from ALE which works brilliantly.

Neomake can do that too: https://github.com/neomake/neomake#setup

Re: Turning vim into an IDE through vim plugins

#39

"NERDTree satisfies this need of mine, replacing vim’s built-in netrw file navigator with a nicer-looking, less buggy, more fully featured alternative." Wait, what's wrong with the built-in netrw? I actually started with NERDTree before I knew netrw existed. After discovering netrw, I switched to it instead. I think it looks just fine and prefer it to the more complex NERDTree.

I agree, it's better to work with the internal tools if possible. I did install Tim Pope's vinegar plugin [0] as it adds some nice tweaks to netrw.

But I've since switched to using FZF [1] and hardly use netrw anymore.

[0]: https://github.com/tpope/vim-vinegar [1]: https://github.com/junegunn/fzf/blob/master/README.md#as-vim...

Post reply on HN