Vim Tips Wiki
No edit summary
 
(Remove html character entities)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{review}}
 
{{review}}
  +
{{TipImported
{{Tip
 
 
|id=643
 
|id=643
  +
|previous=642
|title=Disable built-in command
 
  +
|next=644
|created=January 26, 2004 12:41
+
|created=January 26, 2004
 
|complexity=intermediate
 
|complexity=intermediate
 
|author=Alfvaen
 
|author=Alfvaen
 
|version=5.7
 
|version=5.7
 
|rating=13/6
 
|rating=13/6
  +
|category1=
|text=
 
  +
|category2=
 
}}
 
If there's a built-in key command in Vim that you find annoying, or that you often hit by accident, then you can disable the key by mapping it to nothing. For example:
   
  +
<pre>
 
:map K <Nop>
  +
</pre>
   
  +
For "<Nop>", type the five characters as they appear (less-than N o p greater-than).
If there's a built-in key command in vim that you just can't stand, find annoying, and/or often hit by accident(for me it's "K", with "&gt;" a close second), then you can disable it using ":map". You can't use ":unmap", as you might think. Instead, you can map it to nothing, like:
 
   
 
Of course, you can always
   
  +
<pre>
 
:unmap K
  +
</pre>
   
 
if you start doing C programming and want to instantly "man" things under the cursor again.
:map K &lt;Nop&gt;
 
   
  +
==References==
  +
*{{help|id=<Nop>|label=&lt;Nop&gt;}}
   
 
==Comments==
 
(&lt;Nop&gt; is not the "Nop" key on your keyboards, but literal letters inside literal pointy brackets.)
 
 
 
 
Of course, you can always
 
 
 
 
:unmap K
 
 
 
 
if you start doing C programming and want to instantly "man" things under the cursor again.
 
 
 
}}
 
 
== Comments ==
 
<!-- parsed by vimtips.py in 0.490538 seconds-->
 

Latest revision as of 09:06, 29 September 2008

Tip 643 Printable Monobook Previous Next

created January 26, 2004 · complexity intermediate · author Alfvaen · version 5.7


If there's a built-in key command in Vim that you find annoying, or that you often hit by accident, then you can disable the key by mapping it to nothing. For example:

:map K <Nop>

For "<Nop>", type the five characters as they appear (less-than N o p greater-than).

Of course, you can always

:unmap K

if you start doing C programming and want to instantly "man" things under the cursor again.

References[]

Comments[]