Hacker News new | ask | show | jobs
by greysonp 2630 days ago
Vim is a fantastic text editor, but it is not an IDE replacement. Here's just a few IntelliJ features I use daily that Vim doesn't have: Go to declaration, find usages, rename method/class, change method signature, auto-import, shortcut to override method, easy-to-configure style rules, really good code completion, quick access to javadoc.

I could keep going. Again, not hating on Vim. I use Vim keybindings in IntelliJ! I just don't think it's the best tool for working in large codebases.

4 comments

I think the future on this front is looking pretty bright. I use the awesome vim-go plugin which has support for the features you mentioned. And it's getting better as gopls (the language server) gets finalized. As the Language Server Protocol and the Build Server Protocol develop, I think we'll start to see Vim more closely resemble an IDE for many languages.

I use Vim because I love the history behind it and love knowing that investing my time in learning it is unlikely ever to go to waste. It's a solid editor and also helps keep me as close to understanding the ins and outs of my system and build tools. And for better or worse I just enjoy figuring out the best way to configure things exactly how I want them.

I imagine there are probably IDEs out there with low-friction searching, highlighting, diffing, replacing, block operations, and convenient macros, but I never ran into those features in the IDEs that I've used. I also expect there are probably IDEs out there that don't crash on code bases larger than a GB and code bases which can't be compiled locally, but I haven't used those ones.

>> Here's just a few IntelliJ features I use daily that Vim doesn't have: vim is intended to work with an operating system. The following assumes C or C++ since that's what I use. Maybe someone will find this list of equivalents useful? 1. Go to declaration: I use ctags which is built into vim. clangd can do better, but I've never bothered. 2. find usages: ctags also has support for this I think. 3. rename method/class: I haven't needed to rename something that wasn't exclusively in one file yet, but I expect clang-rename works well. 4. change method signature: not sure what this does. If it's just changing the declaration of the function, that seems pretty easy. ci( 5. auto-import: This one seems harder to get, but I never noticed it wasn't there. For in-project stuff, I just jump to definition. For standard library stuff, it's standard library. 6. shortcut to override method: I don't do much inheritance, so I never really noticed. This seems pretty easy to do a hack job with a macro and jump to definition. 7. easy-to-configure style rules: clang-format 8. really good code completion: basic autocomplete is built into vim. clangd is probably pretty good, but I don't usually need autocomplete. 9. quick access to javadoc: cppman is pretty good. https://stackoverflow.com/questions/2272759/looking-up-c-doc...

Maybe the state of tooling for Java isn't as openly accessible outside of an IDE and isn't as good for vim as C++? If using an IDE works well for you, great. I like using vim because it's lightweight, has good support for different file endings and large files, scales to any size code base I've encountered, and it gets out of my way. I feel like it's optimized enough that my brain is the limiter.

Vim was designed for editing _text_. It was not designed for semantic analysis of _code_. The semantic plugins for Vim are hacky addons.

Having Vim bindings in IntelliJ is indeed the best of both worlds.

How do you get IntelliJ to not shred your CPU to pieces while indexing all the time?
It should not be indexing all the time. Only when you load a new project.
this is _exactly_ my point. Take the plunge. Go IDE-less. Discover how you can play the piano and rename methods yourself with something called "typing" and auto-import is so much fun, it's like a game where I yank and paste the right import from another file. I know it sounds crazy. But at the end of the day I don't fight Intellij but just play music on my keyboard. Disclaimer I was avid eclipse java programmer for years and one day went to vim and never looked back.