Thanks Digital Stimulus, that works in vim. I can now do A, B, and D. Only C remains.
Heh. Much better than “<esc>:q!”, which is what I had been using.
Thanks for the <ctl>f and <ctl>b Redwing.
Sure! Ummmm… <Pulls down Gnu Emacs manual and blows dust off top of book>
To move up or down a line, use <ctl>p or <ctl>n (previous and next). <ctl>f or <ctl>b go forward or back one character. <meta>f or <meta>b go forward or back one word. (<meta> seems to be <Alt> on windows. If there’s no <meta> key, you can use <Esc> (and release it) followed by the character.) To go to a particular line number (say 121), enter <meta>x goto-line <Return> 121 <Return>. <ctl>a or <ctl>e go to beginning or end of line. <meta>< or <meta>> got to beginning or end of document (or use <ctl><home> and <ctl><end>).
To cut text to the end of a line, use <ctl>k. Repeat <ctl>k to remove the newline as well. To cut an arbitrary section of text, enter <ctl><space> at one end, navigate to the other end, and then enter <ctl>f. Use <ctl>v to paste. “copy” is just <ctl>f followed by <ctl>v or <ctl>_ (the undo command). Instead of <ctl>f, use “<meta>x kill-rect” to cut a rectangle of text. “<meta>x yank-rect” is used to paste the rectangle. Again, no “copy”, I just use undo. You can also use the mouse to specify the region to cut (click, drag, unclick).
<ctl>l centers the visible portion of the file on the current line.
I don’t see a similar keyboard command for PageUp or PageDown using letter keys instead. There is the <ctrl>u command, which executes the following command four times, and which can be performed multiple times, so <ctrl>u <ctrl>u <ctrl>u <ctrl>n moves down 64 lines. I’m going to have to remember that one. <ctl>PageUp and <ctl>PageDown will page to the left or right, useful if you have word wrap turned off.
To do item C, enter <meta><shift>5, type in the text to search for then <Ret> then the new text, then <Ret>. The cursor will move to the next occurance of the text. Enter <space> to make the change, or <Del> to skip it. The cursor then moves to the next occurance. At any time, you can enter ! to accept all the changes to the end of the file.
These commands can be changed on your personal account. For a long time, I had <ctl><home> and <ctl><end> set for beginning and end of line, I think because the editor I was using just before emacs worked that way.
Oh, and there are multiple buffers, so you can edit several files at once in a single window, switching between them using <ctl>x b. To see two (or more) files at once, split the screen vertically or horizontally using <ctl>x 2 or <ctl>x 3. Use <ctl>x 0 to unsplit the screen.
Browsing the manual, it seems that emacs has two vi emulators you can try, if you want the worst of both worlds.
I do want to be able to use vim, since the system I want to use it on is through a slow connection. Emacs opens in its own window in Windows, and is very slow to respond. Older versions used to be able to run in the command line window, like vi does. If anyone knows how to force emacs to run that way, without all the graphical stuff, let me know.