Vim Tips Wiki
(Move categories to tip template)
(add jumping to line via the exe command)
Tag: Visual edit
 
(4 intermediate revisions by 3 users not shown)
Line 16: Line 16:
 
42G
 
42G
 
42gg
 
42gg
  +
:42<CR></pre>if you have a command that execute the line under the cursor as vim command, then the following should work.<pre>
:42<CR>
 
</pre>
+
exe 42</pre>
   
 
==Comments==
 
==Comments==
  +
To bring line 42 to the top (centre or bottom) of your screen, add <code>zt</code> (<code>z.</code> or <code>zb</code>) to one of the aforementioned commands.
 
  +
Moreover, to navigate to the '''H'''igher, '''M'''iddle or '''L'''ower part of your screen, just press <code>H</code>, <code>M</code> or <code>L</code> (which are, respectively, capital H, capital M and capital L).
----
 

Latest revision as of 04:28, 15 January 2018

Tip 751 Printable Monobook Previous Next

created June 21, 2004 · complexity basic · author Char · version 5.7


There are at least three different ways to go to a particular line (line 42 for example):

42G
42gg
:42<CR>

if you have a command that execute the line under the cursor as vim command, then the following should work.

exe 42

Comments[]

To bring line 42 to the top (centre or bottom) of your screen, add zt (z. or zb) to one of the aforementioned commands. Moreover, to navigate to the Higher, Middle or Lower part of your screen, just press H, M or L (which are, respectively, capital H, capital M and capital L).