Vim Tips Wiki
We recommend that you log in before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your Watchlist. Creating an account is quick and free.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 11: Line 11:
 
|category2=
 
|category2=
 
}}
 
}}
βˆ’
When scrolling or searching through a large file it is easy to lose sight of the cursor. A simple way to locate the cursor is to type <code>zz</code> (which scrolls the cursor line to the middle of the window), or to quickly type <code>jk</code> (which moves the cursor down then up; the movement shows where the cursor is). This tip shows other ways to find the cursor with highlighting.
+
When scrolling or searching through a large file it is easy to lose sight of the cursor. A simple way to locate the cursor is to type <tt>zz</tt> (which scrolls the cursor line to the middle of the window), or to quickly type <tt>jk</tt> (which moves the cursor down then up; the movement shows where the cursor is). This tip shows other ways to find the cursor with highlighting.
   
 
==Highlighting text near the cursor==
 
==Highlighting text near the cursor==
Line 30: Line 30:
 
</pre>
 
</pre>
   
βˆ’
The search pattern uses <code>\%#</code> to match the cursor position, including <code>\k*</code> (all consecutive keyword characters) before and after that match. {{help|/\%#}} {{help|/\k}}
+
The search pattern uses <tt>\%#</tt> to match the cursor position, including <tt>\k*</tt> (all consecutive keyword characters) before and after that match. {{help|/\%#}} {{help|/\k}}
   
βˆ’
The match uses the <code>Todo</code> highlight group.
+
The match uses the <tt>Todo</tt> highlight group.
   
 
==See also==
 
==See also==
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)