Vim Tips Wiki
(Change to TipImported template + severe manual clean)
(Undo revision 37780 by 27.251.30.70 (talk))
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{review}}
 
 
{{TipImported
 
{{TipImported
 
|id=336
 
|id=336
Line 9: Line 8:
 
|version=5.7
 
|version=5.7
 
|rating=170/70
 
|rating=170/70
  +
|category1=
  +
|category2=
 
}}
 
}}
 
An easy way to to get to a line (whose number we know) faster is to combine some existing methods:
 
An easy way to to get to a line (whose number we know) faster is to combine some existing methods:
 
 
<pre>
 
<pre>
:123&lt;Enter&gt;
+
:123<CR>
 
or
 
or
 
123G
 
123G
Line 21: Line 21:
   
 
The solution is to map in normal mode the enter to G.
 
The solution is to map in normal mode the enter to G.
 
 
<pre>
 
<pre>
:nmap &lt;Enter&gt; G
+
:nmap <CR> G
 
</pre>
 
</pre>
   
we can type the line number and then press enter to get there.
+
We can type the line number and then press Enter to get there.
   
 
==Comments==
 
==Comments==

Revision as of 05:19, 27 August 2014

Tip 336 Printable Monobook Previous Next

created October 3, 2002 · complexity basic · author Odyss · version 5.7


An easy way to to get to a line (whose number we know) faster is to combine some existing methods:

:123<CR>
or
123G
or
123gg

The solution is to map in normal mode the enter to G.

:nmap <CR> G

We can type the line number and then press Enter to get there.

Comments

Though

:123[Enter]

takes you to line 123 in the file,

123[Enter]

takes you 123 lines down from your present position.