This is a superb overview! I’ve used Vim for about 2 years now, but I still learned a bunch of things from this post that I didn’t pick up from other cheatsheets or articles.
My 2-cents: Vim itself is powerful as an editor, but I always missed some IDE features. What I’ve come to realise is that the real power of Vim is not the editor, but the keybindings. I installed the Vim extension in VSCode some time ago and have loved the hybrid workflow. Since then, I’ve been gradually incorporating Vim keybindings into all the tools I use for text — like Overleaf for writing papers in LaTeX and Zettlr for writing notes in Markdown. I still use Vim itself for small scripts and quickly editing files. It’s so powerful being able to go between applications and never have to think about what your fingers are doing to transform ideas into output.
One thing I still haven’t quite figured out is in-browser text entry. So far, I haven’t liked the solutions I’ve found, but it’s something I’m looking into for the future. Writing this comment without my usual keybindings is… slow.
I have to agree with this. Having one set of keybindings that you can take with you to most editors is something that really adds to the value of learning vim. I learned Sublime Text’s shortcuts, then IntelliJ’s shortcuts, which required a separate retraining. Learning vim required retraining again, but now I can bring that effort with me to new editing environments.
I’m in the same boat. I do most of my text editing in Spacemacs with Vim keybindings. Please let me know if you figure out a good in-browser text entry solution.
I have an AutoHotKey script that copies any highlighted text, pops up a gVim window with that text, and then I can save it back into the clipboard with :wq. I works on any plain text field in any app that respects the C-c copy-selection shortcut. I’m sure someone with your skills could put together something similar. I think I had a variant that would also C-a to select all and then C-v after I closed gVim.
I also have a more involved AHK script that does a subset of vim commands in any normal text field while I hold down the tab button. Getting the f command to work was a bit of a trick. I kind of stopped using it once I got a Lenovo with a TrackPoint, but if anyone is interested I could try to dig it up and put in on GitHub or something.
It’s funny that this came up on LessWrong around this time, as I’ve just recently been thinking about how to get vim-like behavior out of arbitrary text boxes. Except I also have the additional problem that I’m somewhat unsatisfied with vim. I’ve been trying to put together my own editor with an “API first” mentality, so that I might be able to, I don’t know, eventually produce some kind of GTK widget that acts like my editor by default. Or something. And then maybe it’ll be easy to make a variant of, say, Thunderbird, in which the email-editing text box is one of those instead of a normal text box.
(If you’re curious, I have two complaints about vim. (1) It’s a little bloated, what with being able to open a terminal inside of the editor and using a presumably baked-in variant of sed to do find-and-replace rather than making you go through a generic “run such-and-such program on such-and-such text selection” command if you want the fancy sed stuff. And (2) its commands are slightly irregular, like how d/foo deletes everything up to what the cursor would land on if you just typed /foo but how dfi deletes everything up to and including what the cursor would land on if you just typed fi.)
Vim is far from optimal, but it’s very customizable, which makes it easy to paper over the more obvious cracks.
For alternative ideas, the Canon Cat had a pretty well-designed interface for text editing, which Jef Raskin described in The Humane Interface, which has influenced my thinking about UI design. It’s still not as fast as Vim, but much easier to learn. The 80% solution for the 20% effort maybe. If you want to try it out, it’s old enough that you can emulate it in your browser, although I had to download MAME to get all the keybindings working.
This is a superb overview! I’ve used Vim for about 2 years now, but I still learned a bunch of things from this post that I didn’t pick up from other cheatsheets or articles.
My 2-cents: Vim itself is powerful as an editor, but I always missed some IDE features. What I’ve come to realise is that the real power of Vim is not the editor, but the keybindings. I installed the Vim extension in VSCode some time ago and have loved the hybrid workflow. Since then, I’ve been gradually incorporating Vim keybindings into all the tools I use for text — like Overleaf for writing papers in LaTeX and Zettlr for writing notes in Markdown. I still use Vim itself for small scripts and quickly editing files. It’s so powerful being able to go between applications and never have to think about what your fingers are doing to transform ideas into output.
One thing I still haven’t quite figured out is in-browser text entry. So far, I haven’t liked the solutions I’ve found, but it’s something I’m looking into for the future. Writing this comment without my usual keybindings is… slow.
I have to agree with this. Having one set of keybindings that you can take with you to most editors is something that really adds to the value of learning vim. I learned Sublime Text’s shortcuts, then IntelliJ’s shortcuts, which required a separate retraining. Learning vim required retraining again, but now I can bring that effort with me to new editing environments.
In addition, some old Unix utilities like
less
use a subset of Vim keybindings by default.Yes! Even many websites and web apps implement some Vim standards. Particularly
\
for search.I’m in the same boat. I do most of my text editing in Spacemacs with Vim keybindings. Please let me know if you figure out a good in-browser text entry solution.
I have an AutoHotKey script that copies any highlighted text, pops up a gVim window with that text, and then I can save it back into the clipboard with :wq. I works on any plain text field in any app that respects the C-c copy-selection shortcut. I’m sure someone with your skills could put together something similar. I think I had a variant that would also C-a to select all and then C-v after I closed gVim.
I also have a more involved AHK script that does a subset of vim commands in any normal text field while I hold down the tab button. Getting the
f
command to work was a bit of a trick. I kind of stopped using it once I got a Lenovo with a TrackPoint, but if anyone is interested I could try to dig it up and put in on GitHub or something.It’s funny that this came up on LessWrong around this time, as I’ve just recently been thinking about how to get vim-like behavior out of arbitrary text boxes. Except I also have the additional problem that I’m somewhat unsatisfied with vim. I’ve been trying to put together my own editor with an “API first” mentality, so that I might be able to, I don’t know, eventually produce some kind of GTK widget that acts like my editor by default. Or something. And then maybe it’ll be easy to make a variant of, say, Thunderbird, in which the email-editing text box is one of those instead of a normal text box.
(If you’re curious, I have two complaints about vim. (1) It’s a little bloated, what with being able to open a terminal inside of the editor and using a presumably baked-in variant of sed to do find-and-replace rather than making you go through a generic “run such-and-such program on such-and-such text selection” command if you want the fancy sed stuff. And (2) its commands are slightly irregular, like how d/foo deletes everything up to what the cursor would land on if you just typed /foo but how dfi deletes everything up to and including what the cursor would land on if you just typed fi.)
Vim is far from optimal, but it’s very customizable, which makes it easy to paper over the more obvious cracks.
For alternative ideas, the Canon Cat had a pretty well-designed interface for text editing, which Jef Raskin described in The Humane Interface, which has influenced my thinking about UI design. It’s still not as fast as Vim, but much easier to learn. The 80% solution for the 20% effort maybe. If you want to try it out, it’s old enough that you can emulate it in your browser, although I had to download MAME to get all the keybindings working.