How can I turn on line numbering in Vi?
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)