Vim Tips Wiki
(Change <tt> to <code>, perhaps also minor tweak.)
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{review}}
+
{{Duplicate|8}}
 
{{TipImported
 
{{TipImported
 
|id=462
 
|id=462
 
|previous=461
 
|previous=461
 
|next=463
 
|next=463
|created=April 22, 2003
+
|created=2003
|complexity=intermediate
+
|complexity=basic
 
|author=Nitya
 
|author=Nitya
|version=5.7
+
|version=6.0
 
|rating=45/42
 
|rating=45/42
|category1=
+
|category1=Getting started
|category2=
+
|category2=Moving
  +
|category3=Navigation
  +
|category4=Searching
 
}}
 
}}
 
Place the cursor on any variable in your program.
 
Place the cursor on any variable in your program.
*<tt>gd</tt> will take you to the local declaration.
+
*<code>gd</code> will take you to the local declaration.
*<tt>gD</tt> will take you to the global declaration.
+
*<code>gD</code> will take you to the global declaration.
*<tt>g*</tt> search for the word under the cursor (like <tt>*</tt>, but <tt>g*</tt> on 'rain' will find words like 'rainbow').
+
*<code>g*</code> search for the word under the cursor (like <code>*</code>, but <code>g*</code> on 'rain' will find words like 'rainbow').
*<tt>g#</tt> same as g* but in backward direction.
+
*<code>g#</code> same as g* but in backward direction.
  +
*<code>gg</code> goes to the first line in the buffer (or provide a count before the command for a specific line).
*<tt>ggdG</tt> deletes all lines (remember <tt>u</tt> to undo).
 
  +
*<code>G</code> goes to the last line (or provide a count before the command for a specific line).
   
==Comments==
+
==See also==
  +
*<code>gf</code> will [[VimTip299|go to the file under the cursor]]
Set your 'path' variable properly, put the cursor on a filename (in a #include say) and do a
 
  +
*<code>g]</code> and other commands will [[Browsing_programs_with_tags|jump to a tag definition]] (a tag can be a function or variable name, or more).
gf
 
   
  +
==Comments==
----
 
This will take you to the file under the cursor in the path or current working directory.
 

Latest revision as of 05:32, 13 July 2012

Duplicate tip

This tip is very similar to the following:

These tips need to be merged – see the merge guidelines.

Tip 462 Printable Monobook Previous Next

created 2003 · complexity basic · author Nitya · version 6.0


Place the cursor on any variable in your program.

  • gd will take you to the local declaration.
  • gD will take you to the global declaration.
  • g* search for the word under the cursor (like *, but g* on 'rain' will find words like 'rainbow').
  • g# same as g* but in backward direction.
  • gg goes to the first line in the buffer (or provide a count before the command for a specific line).
  • G goes to the last line (or provide a count before the command for a specific line).

See also[]

Comments[]