Technology TidBits

Answers to various technical questions on php programming, mysql, linux, and many more categories.



Add comment:
Name:
Email:
Comment: *
(Use BBcode - No HTML)


You MUST answer this simple math equation - to prevent spammers: 9 + 1 =  


How can I turn on line numbering in Vi?

Last updated: 07/02/2009
Sometimes it is useful to view line numbers when editing a file, and especially when coding.  To turn on this numbering in the vi editor, type this:

:set number
(enter)

You should see something like this in your editor:


      1 .text {
      2         font-family: Arial, Helvetica, sans-serif;
      3         font-size: 12px;
      4 }
      5 .green_text {
      6         font-family: Arial, Helvetica, sans-serif;
      7         font-size: 12px;
      8         font-weight: bold;
      9         color: green;
     10 }
     11 h3 {
     12         font-family: Arial, Helvetica, sans-serif;
     13         font-size: 16px;
     14 }


To turn off the numbering, simply type:

:set nonumber

(enter)




Powered by KnowledgebasePublisher 1.1
Superb Internet
Content provided by Roberts WebForge, Inc.