Hacker News new | ask | show | jobs
by smlavine 481 days ago
I'm in university right now and am working on a semester long group project with a few other folks. It's written in C. Most (all?) of the rest of them use VS Code, I use NeoVim. I've observed that, while VS Code isn't a major limitation in writing code, Vim is a lot faster at editing code.

Changing designs, data structures, similar logic across several functions, copying existing files to new locations and making minor edits. These and other tasks are so much faster with visual mode selections, Quick file-wide find and replace/ignore, freaking recording a macro and then executing it 100 times in a handful of seconds -- this is a real difference, and it scales.

Maybe it's just that I'm much more familiar with the ins and outs of how to use Vim efficiently for this purpose, and maybe VS Code can be equally efficient. But when you learn Vim, these are things that you will learn -- or at least learn about -- very soon. With VS Code, you will reach a plateau you don't even know about because these are not the features that VS Code differentiates itself with -- namely, fast in-editor documentation, jump to definition, visualize file structure, etc. Useful things when writing new code fast, sure, but not necessarily editing en masse.

2 comments

You can do all that in VS Code with the vim extension. I'm with you on the vim keystrokes, but configuring debuggers, code completion, etc. in vim never seemed worth the effort. With VS Code and vim keybindings, it's the best of both worlds.
VS Code's vim extension is the _first_ non-vim implementation I've used that "has the Buddha nature".

1) macros

2) ctrl-w <hjkl> "does the right thing" with visual (IDE) window-splits(!!)

I just about fell out of my chair when I stumbled upon <c-w> in a random vscode session (almost literally).

Many editors pay lip service and think "if we stop at hjkl, that's good enough!" Even fewer make it to a rational macro implementation, but vim is so much more.

The fact that vscode "does the right thing" when stabbed with <c-w> is incredible... now if only I could figure out how to get simplistic <c-p>/<c-n> to work with raw strings instead of trying to omni-complete...

There is a Neovim plugin for VSCode that uses an embedded implementation of Neovim in the background that lets you use the full power of Neovim in VSCode, and even most Neovim plugins work too.
I'm not sure I fully understand but changing a lot of code nowadays, we mostly offload the tedious part to an LSP.

Using clangd in vscode, I don't see how you'd be faster in neovim making changes by glorified search and replace? Also you're limited at "file-wide" and not project wide?

LSPs can only do fairly narrow, predefined changes, I honestly get excited when I finally get something that'll fit in that box.
Well, my knowledge stops at "file-wide" at least :) Thinking more now I think the most important part is knowing what your tools are capable of and how to use them to their fullest, more so than the particular environment (assuming that such capabilities exist at all).
there is LSP in vim, among other things