by greyman · 3y ago · 0 comments
The right setting for me is Vim within an IDE (nowadays VSCode) but I've found it too complicated to try to turn it into an IDE. I find it appealing to be able to do all your work within tmux/vim, and I know a lot of great coders work that way but it's been too much hassle for me.
I also wonder if Vim is a productivity gain at all. I like to be able to navigate/edit a file without taking off my hands from the home row, and also quickly edit a file when I'm in the terminal. But not sure it really makes that much of a difference when you know your VSCode/MacOS shortcuts, and I suppose that with proper configuration, you can also edit file remotely with VSCode and restrict the need for edition within a terminal.
The big productivity gain for me doesn't come from faster editing due to the shortcuts, per se, but from the golden combo of modal editing and macros. Due to how you treat similar looking text in vim, macros are much more powerful than something like multi-line-cursors, which break down when you want to, for instance, delete the first part of 5 pascalCased variables with different lengths. Luckily, iirc, the vim integration in VSCode supports macros, so people who want to keep working in VSCode because of the excellent ecosystem can still have the best of both worlds.
In VSCode there are available bindings for subword navigation (shortcuts starting with cursorWordPart).
Conversely, saying "delete in parens" instead of "move forward 5, delete back 10" is also a real gain.
That being said, use what you have. With editing, and navigating the same file, Vim or it's emulations are almost always better, but most editors offer great cross-file features you should also use, like the "shift shift" in Intellij IDEs, or "ctrl-p" in vscode.
In my head all I can think of is all the ways it could be done faster in vim, so it's absolutely a productivity gain, even if it's just a plugin for vscode.
As a quick example what are the vscode equivalents of I and A to enter insert mode in the beginning or end of a line? These small things quickly add up.
(even though it's not 'real vim', it's good enough for using both cmdline vim and vscode without the brain having to switch in and out of 'vim mode')
Combine that with the fact that all the UI elements are not vim-ified. In vim, since everything is a pane and a buffer, you just think "I want to select the panel to the left". Regardless of if it's a plugin view or a file or whatever.
In vim emulator's, that's never the case. It's really not the same, but better than nothing. The vscode plugin and the IntelliJ one are both pretty good compared to previous ones that I tried. But the IDEs are just incompatible with the vim ideology, in my opinion.
Just a little counterpoint basically - I don’t think you need Vim’s entire editor model to get a lot of value out of it!
If nothing else, the performance characteristics of vim are predictable (to me, after all these years) and there are various ways to work around any problems that occur (disabling plug-ins, etc).
Not once in the past eight years have I had to use tabs for something. The buffer list, yes. The argument list, yes. Tabs, no.
there are almost always quirks, but the biggest issue tends to be when bridging the gap between vim and the GUI itself, particularly around the modality of vim vs graphical autocomplete.
If you're less experienced as a vim user these emulators are probably perfectly fine, but as someone who has been using vim for something like 20+ years, they _always_ feel just off enough that I either just go back to vim or edit the way the editor originally intended.
If you keep at it you will develop the muscle memory. I am not an expert in Vim, but I use it whenever I want to write some code. Once I was given a coding problem to solve. The interviewer gave his laptop to me with part of the program implement and I had to complete the program. The problem was the C++ code was written in Visual Studio on Windows and I had not used that setup for a long time. So it was frustrating for me and amusing to the interviewer to see when I use to press Vim keystrokes while writing the code in VS :)
And this is why I have never been comfortable with vim or the idea learning it on that level. Why would I spend time muscle memorizing a program that conflicts so much against all other editing software and related paradigms? The skills do not scale enough to make it worth the effort imo. Sure your vim powers skyrocket but any other interface where you have to type becomes a nightmare to work with effectively.
Are the advantages of working really really well with one tool worth the effort when you lose productivity in every other tool (99.9% of them) out there? Maybe if you can live constantly in vim but how many of us truly only edit text files during our day to day?
Because no other editor is oriented to muscle-memorizing.
> any other interface where you have to type becomes a nightmare to work with effectively.
Something tells me that you are talking about some interfaces with mouse. It's really a nightmare for mine inner vimmer to get my hands out of keyboard in any other editing interface or even to look at keyboard for searching those Alt-Ctrl-Shift chords.
Many other programs loosely follow vim bindings. For example if you enable hotkeys in GMail webclient you can use j and k keys to move between emails, press / to search just like in vim.
In the comment you replied to the author was in an interview situation so they didn't have time to install any plugins.
If you really want to ease into it then simply enable the (neo) vim plugin in vscode, it's pretty good. You'll miss some big features but you'll have all the bread and butter features. Only risk is that you'll get used to some vscode features as well.
Then one day I realised I was still more productive in sublime with its simple but powerful keybindings than I was in vim. I dropped it and never looked back.
If you're serious about it, you should use it for everything and use it a lot.