Quick Tip: Displaying the current and total lines in a document with vi

While editing a document in vi you may need to determine the total number of lines in that document or what line the cursor is currently on. Both sources of information can be accomplished with the following commands;

  • := displays the total number of lines in a document
  • :.= displays the current line the cursor is on
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s