Skip to content
This repository
tree: 1563771179
Fetching contributors…

Cannot retrieve contributors at this time

file 67 lines (58 sloc) 2.097 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
<h3 id="navigating-text-files">Navigating Text Files</h3>

<h4>Problem</h4>

<p>You're editing a text file such an essay or e-mail, and want to exploit its
structure to navigate it efficiently.</p>

<h4>Solution</h4>

<p>In <i>Normal</i> mode you can use the following shortcuts:</p>

<table>
  <tr>
    <th>Key</th>
    <th>Move To</th>
  </tr>
  <tr>
    <td><kbd>{</kbd></td>
    <td>Beginning of current paragraph</td>
  </tr>
  <tr>
    <td><kbd>}</kbd></td>
    <td>End of current paragraph</td>
  </tr>
  <tr>
    <td><kbd>(</kbd></td>
    <td>Beginning of current sentence</td>
  </tr>
  <tr>
    <td><kbd>)</kbd></td>
    <td>End of current sentence</td>
  </tr>
  <tr>
    <td><kbd>w</kbd></td>
    <td>Beginning of next word</td>
  </tr>
  <tr>
    <td><kbd>b</kbd></td>
    <td>Beginning of the previous word</td>
  </tr>
  <tr>
    <td><kbd>e</kbd></td>
    <td>End of the word</td>
  </tr>
</table>

<h4>Discussion</h4>

<p>The shortcuts above all rely on the fact that plain text is often very
structured. A document consists of paragraphs separated by newlines.
Paragraphs contain one or more sentences which begin with capital letters and
end with periods. Sentences are collections of words which are separated by
spaces.</p>

<p>After using one of these shortcuts you may want to return to where you were
previously. This is particularly useful if you're writing one thing and are
then reminded that you now have to change another: you use a shortcut to jump
to the location of the change, then want to resume where you left of. You can
use the <kbd>g,</kbd> (mnemonic: <i>g</i>o back to where I paused (commas can be
used to represent pauses&#x2026;)) command. Each time you execute it you'll be
taken back another step. To move in the other direction (towards more recent
changes), use <kbd>g;</kbd>.</p>

<p>All of these shortcuts can be combined. So, to move to the end of the previous
word you type <kbd>be</kbd>. You can also prefix them with numbers to indicate
how many times they should be executed: <kbd>3b</kbd> moves to the beginning of
the 3rd previous word.</p>
Something went wrong with that request. Please try again.