Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is a backslash which does nothing by default, only being the default value of mapping leader (both mapleader and maplocalleader). This leader is used in plugins and I strongly suggest to leave it for them only, using keys that have default actions attached, but that are not much useful. Common keys are <code>,</code> (repeats t/T/f/F motion in the opposite direction) and <code>_</code> (moves one line downward, on the first non-blank character), you can also check which ones you don’t use (I, for example, don’t use <code>+</code> and <code>-</code>, latter is good replacement for <code>_</code>). The reasons why I unlike @stonesam92 suggest not to set mapleader to them and instead put your own leader in your mappings directly are the following:</p> <ol> <li>It makes plugins possibly add mappings conflicting with your own ones.</li> <li>You get used to typing <code>,a</code>, <code>_a</code> or whatever, not to <code>&lt;Leader&gt;a</code>.</li> <li>It makes mapping commands work differently depending on their location in the vimrc (<code>&lt;Leader&gt;</code> is computed only once, if you change mapleader afterwards already defined mappings won’t change).</li> <li>It obfuscates the reading: you have to always remember, what <code>&lt;Leader&gt;</code> is.</li> </ol> <p>If you are writing plugin, always use <code>&lt;Leader&gt;</code> and also leave the user the better way to customize them, two common solutions are using global options and using <code>hasmapto</code>:</p> <pre><code>" Global option if !exists('g:plugin_mapping_key') let g:plugin_mapping_key='&lt;Leader&gt;a' endif execute 'nnoremap '.g:plugin_mapping_key.' :DoSomething&lt;CR&gt;' " hasmapto nnoremap &lt;Plug&gt;PluginDoSomething :DoSomething&lt;CR&gt; if !hasmapto('&lt;Plug&gt;PluginDoSomething', 'n', 0) nmap &lt;Leader&gt;a &lt;Plug&gt;PluginDoSomething endif </code></pre>
 

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