No one ever wrote:vi is intuitive
Powerful maybe, but not intuitive. I don't think discoverability was even a word when vi was created.
Yes, it's intuitive, once you understand basic syntax. Here is a random smattering of command parts:
d is Delete.
c is Change.
y is Yank (copy).
Then there are motion commands:
e is move to End of word.
$ is move to end of line.
b is move Back to the most recent start of a word.
} is move to end of paragraph.
( is move to start of sentence.
Now, you use the motion commands by themselves to move. Simple enough so far?
Great, now let's say you want to delete to the end of the word. Just type "de".
What if you want to change
all text from the cursor position to the end of the sentence? Type "c)" and then type in the replacement text for the text that has just been visually removed.
Can you see how these command parts can be combined? I think that's pretty intuitive; just by reading the 8 commands I listed you now know 15 different commands (3x5).
The real magic of vi is in repeatability, especially using the "." operator. It repeats the last full command
—and with a "change" command, that includes
the replacement text you added.
So, let's say you want to rename a variable everywhere it occurs in your file. Move your cursor onto one instance of the variable, type "*" (which is a shortcut that searches for the word under your cursor and puts you at the beginning of the next instance of that word), then type "ce" to change to the end of the word. Type the new variable name, press "<Esc>" to exit insert mode, and then press "n" to go to the next instance of the last used search term. Then, you want to rename that variable? Press "."
So you can interactively rename every other instance of the variable, verifying each change before you make it (maybe there's an instance in a comment you don't want to change?) by just typing "n.n.n.n.n.n.n.n.n.n." until there are no more instances found.
EDIT: Sorry, the above wasn't very warlike.
By the way, Emacs sucks **l** and is ridiculously
non-intuitive. Escape-Meta-Alt-Control-Shift? Please.
There's no such thing as a funny sig.