<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:foaf="https://xmlns.com/foaf/0.1/" xmlns:og="https://ogp.me/ns#" xmlns:rdfs="https://www.w3.org/2000/01/rdf-schema#" xmlns:schema="https://schema.org/" xmlns:sioc="https://rdfs.org/sioc/ns#" xmlns:sioct="https://rdfs.org/sioc/types#" xmlns:skos="https://www.w3.org/2004/02/skos/core#" xmlns:xsd="https://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/vi">
  <channel>
    <title>vi</title>
    <link>https://www.linuxjournal.com/tag/vi</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Dr Hjkl on the Command Line</title>
  <link>https://www.linuxjournal.com/content/dr-hjkl-command-line</link>
  <description>  &lt;div data-history-node-id="1338726" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/keyboard_black_4.jpg" width="500" height="334" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/kyle-rankin" lang="" about="https://www.linuxjournal.com/users/kyle-rankin" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Kyle Rankin&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
The first time I used vi was in a college programming course. It was the
default editor on the computer lab's UNIX systems we used to compile our
assignments. I remember when our professor first introduced vi and
explained that you used the hjkl keys to move your cursor around instead of
the arrow keys. Before this point, I was a pico user (that dates me a bit
now), and it seemed so backward to me that vi used hjkl instead. 
&lt;/p&gt;

&lt;p&gt;
It wasn't
until I became a heavy vim user that I began to appreciate the speed you
gain from navigation keys appearing on home row. As a touch typist, I
realized the arrow keys are in a no-man's land outside the home row
compared to hjkl, and even though vim supported arrow keys, I used hjkl
instead. I've been pleased to discover a number of different programs that
also support the same level of key bindings. 
&lt;/p&gt;

&lt;p&gt;
I've written a few other
columns in &lt;em&gt;Linux Journal&lt;/em&gt; through the years along those lines (all with Dr
Hjkl in the title), and here, I've decided to revive Dr Hjkl for
another round of time-saving command-line navigation tips that will help keep
your hands on the home row and off those arrow keys.
&lt;/p&gt;

&lt;p&gt;
Most of my tips in this article are about reducing your reliance on the
arrow keys and increasing your speed when on the command line. For many
years, whenever I would find a mistake in a command I typed, I would do one
of two things: use a combination of Home, End and the arrow keys (all way
too far away from home row) to move the cursor back to the mistake so I
could fix it, or sometimes I found it was faster to press Ctrl-C and type the
whole command again. One day I observed another Linux user fly back and
forth across words on the command line and realized there was a better way.
&lt;/p&gt;


&lt;h3&gt;
Moving Between Words&lt;/h3&gt;

&lt;p&gt;
The first simple speed improvement is the use of Alt-b and Alt-f to move
backward or forward one word on the command line. This behaves somewhat
like the b and w keys in vi to skip between words instead of one letter at
a time. Alt-b acts like just like b in vim. Press Alt-b, and the cursor will
move back one word and sit at the first letter of the previous word. Alt-f
is slightly different; the cursor moves forward until it ends up at the
space between words instead of at the beginning of the following word. So
given the following command:

&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/dr-hjkl-command-line" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 21 May 2015 19:43:05 +0000</pubDate>
    <dc:creator>Kyle Rankin</dc:creator>
    <guid isPermaLink="false">1338726 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
