note
dragonchild
You forgot a number of very important commands and distinctions:
<ol>
<li>vi's regex language is <b>very</b> different than Perl's. It's much more akin to the shell command grep's. Specifically, there is no + and you only have back-references.
<li>Aliases:
<ul>
<li>Colon Mode:
<ul>
<li><i>:x</i> is <i>:wq</i>
<li><i>:NN</i> moves you to the NNth line. <i>:$</i> moves you to the bottom of the file.
<li><i>:!asdf</i> executes asdf in the shell.
<li><i>:map X asdfasdf</i> will map the key X to the key sequence asdfasdf. These are macros, to be used in Nav Mode. My favorites are:
<ul>
<li><i>v</i> - :!perl -wc %^V^M (That's Ctrl-V, Ctrl-M.) - compile the current file in Perl.
<li><i>V</i> - :!%^V^M - Execute the current file.
<li><i>q</i> - :e #^V^M - Switch you to the last buffer. (Read up if you want to know what these are.)
</ul>
</ul>
<li>Nav Mode
<ul>
<li><i>0</i> is <i>^</i>
<li><i>z-z</i> moves the screen to center on your line. <i>z-Enter</i> moves the screen so that your line is on the top. (There's on that does it for the bottom, but I never remember it.)
<li><i>o</i> inserts a new line below where you are and puts you in Insert Mode at the beginning of it. <i>O</i> does it for above.
<li><i>w</i> goes the beginning of the next word. </i>b</i> to the prior. </i>e</i> to the end of the current word.
<li><b><i>J</i> takes the next line and puts it at the end of the current line.</b>
</ul>
</ul>
</ol>
<p>The reason to use vi is that, once you understand it, it's is extremely efficient to edit in. I found that my productivity in sheer editing is almost as fast as I think. (Which, granted, isn't that fast, but still!)
<div class="pmsig">
<div class="pmsig-85580">
<p>------
<br><i>We are the carpenters and bricklayers of the Information Age.</i>
<p>Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
</div></div>
333737
333737