So I would suggest maybe a curated list of problems that need to be solved and their vim solutions, with a method of searching for them when needed and a way of suggesting one of those problems/solutions every so often. Kind of like a daily/weekly helpful tip that gives them out in order of complexity. These would be things like how to swap two lines, keyword search and replace, how to insert something at the start of a set of lines, how to join lines, how to use buffers, etc. Ideally, a vim plugin could watch for the basic ways of doing more complicated things, like someone deleting the same number of characters one at a time on each line, repeatedly, and let them know about repeat counts, or seeing someone deleting characters one at a time stopping at a space and typing new text in multiple times and let them know about "ce".
I started learning Vim 2009 when an older and much more experienced colleague of mine was making funny comments about me using Notepad++. "Get a real text editor" he was saying. At the time, I never really thought about the need of learning a new text editor, specially one as old as Vim. Though to impress this colleague I decided to learn Vim, and demonstrate powerful Vim tricks that my colleague didn't know. This carried on into an obsession with Vim. Drew Neil, the author of Practical Vim book, and the maker of the Vimcasts, used to run a Vim Dojo in London circa 2013, and I found that to be a great source of learning Vimscripts and writing tests with Vim.
This could be hard to explain, but the more I learned Emacs the more I found better ways of doing the same Emacy thing in Vim.
Inspired by him, I made a 20 minute React JS tutorial[2] going over how to build a web app that teaches you Vim.
I was on the market for a TextMate replacement that worked both on Mac OS X (at work) and Linux (at home) so I searched far and wide and came up with a list of editors and IDEs, GUI and TUI. I approached all of them with the same strategy:
1. follow the introductory tutorials, if any,
2. if the first contact was promising, use it for a while, learning and configuring as I go,
3. move to the next editor/IDE in the list.
For some, I gave up after half an hour, for others it went on for a few weeks, but I wanted to give all of them a fair chance so I eventually ended up at the bottom of the list, with Vim and its weirdo reputation.
So I did `$ vimtutor` and I was instantly hooked. As instructed, I graduated to the user manual which I stupidly rushed only to fall into the blogosphere trap and its many "here is my setup" posts. The winner was clear at that point and, after wasting a couple months trying to shoehorn my TextMate workflow, I finally decided to throw my `.vim` through the window and learn Vim properly this time, with the user manual.
Two months after that I was finally able to replace TextMate with Vim and I have never looked back.
Second, thoughts on learning Vim.
- Random online snippets, quick tips and tricks, tweets, etc. are useless because they lack context. They are also wrong very often.
- Using it right away for work is a bad idea because it forces you to copy other people's config and install lots of plugins that hide Vim and ultimately prevent you from learning it properly.
- Learning/using Vim has nothing to do with muscle memory. This is a common misconception that leads to rote learning and, since Vim has hundreds of commands, the use of flawed ready-made cheatsheets _and_ the looking for ways to bypass that horrifying learning curve.
- A flight simulator is not a plane and a tool-for-learning-vim-that-is-not-vim is not Vim. There are very good reasons for doing part of one's learning on a flight simulator but learning Vim in Vim is as free and safe as it gets so there is no point learning it via a third party tool.
Third, thoughts on your project.
There is no _need_ for anything else than `$ vimtutor` and `:help user-manual`.
To learn 'vi' I had an 8.5 x 11 tri-fold cheetsheet that I printed out, pinned to the wall of my cubicle (yeah, it was a while ago) and referred to in constantly. Even when I wasn't editing, I'd take it down and browse up and down the columns to see what I knew/used that I hadn't before and recognize more stuff that made sense now when I had to memorize it without reason. Eventually you see how all the patterns fit together and how small it all is, wondering how you couldn't see it all from the start.
As for the muscle memory. Just get over the hump. Another pro tip. If you were thinking about using a custom keyboard layout, sort that out, because vi(m) muscle memory has nothing to do with alphabetic letters. It would be more like a musical instrument with the scale keys shuffled nonsensically. Sadly I had shooting pains up the backs of my hands, switched layouts and typing words is back but my vim's still slow, rebuilding muscle memory, so I'm with you on that.
Then used it like glorified notepad for ages, eventually finding little hacks like "oh, O will put me on insert mode on the line above"
The starting the grammar, diw, etc
For vim specifically, I think mode changes are the most important to learn first. Past that, it's building muscle memory for all the keybinds (and actually discovering the keybinds).
boss: "You need to learn vi" Me: "Why, this Sun has a text editor on it" Boss: "We own more than Sun workstations, go do this job on the Pyramid" Me: "rsh...ok I'm in. Ok. Uh, how does vi work?"
Not sure it's a real necessity these days when Nano exists but vi or its modern equivalent is on OSX, all(?) Linux distributions and generally shows up in WSL on Windows.
The Vim mode in VSCode is...OK I guess but you do need to be a bit careful with cut and paste, as the paste menu item doesn't necessarily give a hoot about the Vim mode you're in and stuffs things wherever you right clicked rather than where the need the text to go.
I started using vim because in high school a guy I respected at the time started using it, and I wanted to look like a cool hacker or something, so I used it for my programming class assignments.
But yeah, you just have to use it. You should generally structure your life so that you can commit to the expense of learning something new for two weeks.
Edit: oops, I just read that you’re asking in the context of helping other people learn. Still, my advice for getting over the hump is to get over the hump, one keystroke at a time.
One never really learns “vim” TBH. Over the years I periodically take a dip in productivity to learn a knew thing and customize my experience. Some things are firmly in my muscle memory. But many things will never make it in there.
That’s the nature of the problem. Vim wants you to take a high level of ownership over the parts you want to emphasize. It’s hard to teach that.
Some people will get great value as a “dumb editor that works over ssh” while others have gone very deep into obscure corners to memorize whatever arcana helps them. All are valid ways to vim IMO.
Recently I did the same with Emacs. I'm a big fan of learning through complete immersion.
My opinion is that my method is horrendously inefficient and arduous. There's a lot of room for deliberate practice.
Here's one: https://www.shortcutfoo.com/app/dojos/vim/learn
If you can improve on that method please do.
What really helped me were my coworkers who already knew vi and showed me a few tricks. Like using "." for repetitive tasks.
I think some example scenarios would be helpful. I rarely use vi these days but I have a soft spot for retro technologies so I think specifically pointing out a few of vi's strong points and contrasting them with the way most editors handle it would be good.
Mouse-free navigation with a few keys and little wrist movement is another strong point so maybe show a few animations how to make the most of that.
I used the VSCode vim extension too, which I believe eased me into it since I was already comfortable with VSCode.
I know the extensions are limited compared to straight vim, but IMO at a certain point you get diminishing returns with time spent learning your tools. Personally for me, getting proficient in normal, insert & visual mode was most worth it; I'm sure I'd benefit from learning how to do crazy macros, but didn't see a need to go beyond that.
I based it on the paper "An Introduction to Display Editing with Vi" by Bill Joy and Mark Horton http://www.verticalsysadmin.com/vi/vi_editor__bill_joy.pdf
Bill Joy is the author of Vi.
It's really as simple as using it. Both vim and i3 seemed insurmountable at first, but after I dove in; I realized things weren't so scary.
Doing things and thinking about it is practice, with that comes muscle memory.
You can honestly get to the point of unconsciously doing a series of events across applications/files. Just don't try too hard, it comes with time.
I have not. I install and use nano https://www.nano-editor.org/ and/or using Far Manager SCP client with the built-in editor.
You can do so much with multiple cursors and a few extensions (expand selection to bracket, insert numbers, and align cursors are the operations I use the most).
That's it. When you do this, you now need to use vim commands to move around the shell.
It's a great way to force learning/reinforce your muscle memory of vim commands.
although I mostly use the one feature - F to select link.