Wikia

Vim Tips Wiki

Changes: Display line numbers

Edit

Back to page

m (Reverted edits by Emprego.curitiba (talk | block) to last version by JohnBot)
Line 41: Line 41:
   
 
==Comments==
 
==Comments==
 
[http://www.vipsexshop.com.br Sex Shop]
 
[http://www.requintesexshop.com.br Sex Shop]
 
[http://www.sexshop.com.vc Sex Shop]
 
[http://www.belasexshop.com.br Sex Shop]
 
[http://www.belasexshop.com Sex Shop]
 
[http://blog.vipsexshop.com.br Dicas de Sexo]
 
[http://www.viplingerie.com.br Lingerie]
 
[http://www.vipcalcinhas.com.br Calcinhas]
 
[http://www.uniformesbr.com Uniformes Profissionais]
 
[http://www.uniformesbr.com Uniformes]
 

Revision as of 14:51, November 8, 2011

Tip 19 Printable Monobook Previous Next

created February 25, 2001 · complexity basic · author scrott · version 5.7


I have started doing all my code reviews on a laptop because of the number command.

This will display line numbers along the left side of a window:

:set number

You can also define a mapping to toggle the option, for example:

:nmap <C-N><C-N> :set invnumber<CR>

By pressing Ctrl-N twice in normal mode, Vim toggles between showing and hiding line numbers.

If you have Vim version 7 or greater, you can change the width of the "gutter" column used for numbering:

:set numberwidth=3

You can use the number column for the text of wrapped lines:

:set cpoptions+=n

Finally, you can change the color used for the line numbers. For example:

:highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE

References

Comments

Around Wikia's network

Random Wiki