How do I make the vi editor display or hide line numbers?

May 20, 2008 at 10:57 am Leave a comment

To make vi display line numbers, you need to set the number flag. To do so:

  1. Press the Esc key if you are currently in insert or append mode.
  2. Press : (the colon). The cursor should reappear at the lower left corner of the screen next to a : prompt.
  3. Enter the following command:
    set number
  4. A column of sequential line numbers will then appear at the left side of the screen. Each line number references the text located directly to the right.

To turn off line numbering, again follow the preceding instructions, except this time enter the following line at the : prompt:
set nonumber

Advertisements

Entry filed under: Uncategorized.

Checking mail queue Displaying HTTP headers

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

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Categories


%d bloggers like this: