Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the vim documentation should've explained the meaning behind the naming of these commands. Just telling you what they do doesn't help you remember the names.</p> <p><code>map</code> is the "root" of all recursive mapping commands. The root form applies to "normal", "visual+select", and "operator-pending" modes. (I'm using the term "root" as in <a href="https://simple.wikipedia.org/wiki/Root_(linguistics)" rel="noreferrer">linguistics</a>.)</p> <p><code>noremap</code> is the "root" of all non-recursive mapping commands. The root form applies to the same modes as <code>map</code>. (Think of the <code>nore</code> prefix to mean "non-recursive".)</p> <p>(Note that there are also the <code>!</code> modes like <code>map!</code> that apply to insert &amp; command-line.)</p> <p>See below for what "recursive" means in this context.</p> <p>Prepending a mode letter like <code>n</code> modify the modes the mapping works in. It can choose a subset of the list of applicable modes (e.g. only "visual"), or choose other modes that <code>map</code> wouldn't apply to (e.g. "insert").</p> <p>Use <code>help map-modes</code> will show you a few tables that explain how to control which modes the mapping applies to.</p> <p>Mode letters:</p> <ul> <li><code>n</code>: normal only</li> <li><code>v</code>: visual and select</li> <li><code>o</code>: operator-pending</li> <li><code>x</code>: visual only</li> <li><code>s</code>: select only</li> <li><code>i</code>: insert</li> <li><code>c</code>: command-line</li> <li><code>l</code>: insert, command-line, regexp-search (and others. Collectively called "Lang-Arg" pseudo-mode)</li> </ul> <p>"<strong>Recursive</strong>" means that the mapping is expanded to a result, then the result is expanded to another result, and so on.</p> <p>The expansion stops when one of these is true:</p> <ol> <li>the result is no longer mapped to anything else.</li> <li>a non-recursive mapping has been applied (i.e. the "noremap" [or one of its ilk] is the final expansion).</li> </ol> <p>At that point, vim's default "meaning" of the final result is applied/executed.</p> <p>"<strong>Non-recursive</strong>" means the mapping is only expanded once, and that result is applied/executed.</p> <p>Example:</p> <pre><code> nmap K H nnoremap H G nnoremap G gg </code></pre> <p>The above causes <code>K</code> to expand to <code>H</code>, then <code>H</code> to expand to <code>G</code> and stop. It stops because of the <code>nnoremap</code>, which expands and stops immediately. The meaning of <code>G</code> will be executed (i.e. "jump to last line"). At most one non-recursive mapping will ever be applied in an expansion chain (it would be the last expansion to happen).</p> <p>The mapping of <code>G</code> to <code>gg</code> only applies if you press <code>G</code>, but not if you press <code>K</code>. This mapping doesn't affect pressing <code>K</code> regardless of whether <code>G</code> was mapped recursively or not, since it's line 2 that causes the expansion of <code>K</code> to stop, so line 3 wouldn't be used.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload