I use Vim for my text editor and I like it, but it is not without challenges.
The first thing to know about vim is how to get out of it. The bad news is there is actually a webpage, How to quit vi. The worse news is those instructions will not always work. I started to write a better how-to-quit page, but it turned out to be harder than I thought to cover every possible case. Maybe later. For now, hit escape and then :q! to quit without saving. Here is a good Vim Commands Cheat Sheet.
If I get too deep into it I start writing mini-programs in my head. I wrote ‘amature’ for ‘amateur.’ How best to change one to the other? ex3hp? Or is there a better way? Other than just retyping it, I mean.
A means to an end
To get the most out of Vim it helps to be always looking for shortcuts. If I find myself doing anything a second time, automate it. For example suppose I have a list of people as Firstname Lastname, and I want to switch to Lastname, Firstname. If it were only to be done once, it would not much matter; A, ^[0dw$p – append to the end of the line a comma and a space, escape, go to the beginning of the line and delete one word, go to the end of line and put the word I deleted; or whatever other way occurs to me. Highlight, cut, and paste; I could even use the mouse, but I do not want to be that guy.
If I were going to do this same edit several times, I would turn on macro recording before I started, and assign a macro to the letter “a”. Then on each line type @a to make the edit. Better, end the edit with a command to go to the next line. Then invoke the macro with @a on the first line, and re-run it with @@ for each line in the file. In effect, hold down the @ key and Vim zips through the file. Still, I do have to hold down the @ key. Better (or maybe overdone) would be to script it.
How to do that? First, search Google for “vim run macro on each line”. That turns up a reference to g//normal @q which I adapt as :g/^/normal @a
This works, except it adds a comma to the end of the file, but that is good enough for now.