[sf-lug] bash shell script tutorial and vi (and vim) starters cheat sheet

Akkana Peck akkana at shallowsky.com
Tue May 5 08:06:30 PDT 2015


jim writes:
> * Here's a link to a vi cheat-sheet I wrote to
> help people get started using vi (it'll always
> be vi to me):
> http://www.systemateka.com/How2vi.html

I like your vi intro cheat sheet -- great introduction!
But I have one suggestion. I found this confusing:

| Use the following commands to change a letter or word while keeping vi 
| in command mode. 
| The  r  command converts a letter to another letter
| The  cw  command converts a word to another word

cw doesn't keep vi in command mode: it does a dw and then puts you
into insert mode. Something like this might be clearer:

| To change a single letter without leaving command mode, use the r
| command followed by the new letter.
| 
| To change a word, cw deletes the word starting from the cursor
| position, then puts you into insert mode so you can type the new word.
| 
| To change a whole line, cc deletes the current line and puts you
| into insert mode.

Of course, there are lots of commands I'm itching to add -- but
you're right to keep the introduction simple and not clutter it
up with everything useful you can do in vi. So I'll limit those
suggestions to one command: u for undo. My favorite command in
practically any program. :-)

        ...Akkana




More information about the sf-lug mailing list