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

  • My favourite (short cut mode), :se nu

  • Thanks man 🙂

  • 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.

© 2008-2012 The Danesh Project
Powered by Wordpress and made by Guerrilla. Hosted at ServerFreak