How to view line numbers in vi

When editing large files in vi or vim line numbers become very important.

This is how you turn on/off line numbers in vi or vim.

Turn on line numbers

While vi is in edit mode and not inserting type the following

:set number

Turn off line numbers

While vi is in edit mode and not inserting type the following

:set nonumber

Screenshots

3 Responses to “How to view line numbers in vi”

Author comments are in a darker gray color for you to easily identify the posts author in the comments

  1. Irwan says:

    My favourite (short cut mode), :se nu

  2. aizatto says:

    If you want this to be permanent, you should enter it into your ~/.vimrc file. In fact go search online for .vimrc files, there are many good tips you can find in them.

Leave a Reply

© 2008-2009 The Danesh Project
Powered by Wordpress and made by Guerrilla. Best viewed in Mozilla Firefox