Home > Articles > How to show line number in vi or vim

How to show line number in vi or vim

Line number in editing text using vi or vim is very useful. It is not shown by default, so..how we can make it visible??. There are two ways that we can do

First, while editing mode (not in inserting text mode), type the following

:set number

to hide it, just type the following

:set nonumber

Second, we can make vi or vim show line number by default. To do it, just write .vimrc in your home directory and add set number (without colon)

If we want to associate with keys (for example f6), we need to type the following in .vmrc

nnoremap <silent> <f6> :set number!<cr></cr></f6></silent>
Tags: , , ,
  1. momo
    March 10, 2011 at 10:36 am

    kok njuk mak bedunduk dadi naightmare…biasane pegel linux😄

    • March 10, 2011 at 10:40 am

      we have to cover everything from linux to social life…..;)

  1. No trackbacks yet.

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

%d bloggers like this: