How To Show Line Numbers In vi / vim Text Editor
2013-01-29 13:31
375 查看
Q. How do I display vi / vim text editor line numbers while writing a shell script or c program? How can I turn on or off this feature?
A. Displaying line numbers under vi / vim can be very useful for debugging code errors and to improve overall readability of a program.
To display line numbers along the left side of a window, type any one of the following:
:set
numberor
:set
nu
(Fig.01:
Vi / Vim line numbers in action - click to enlarge image)
To turn off line number again enter the same command:
:set
nu!If you need number every time you start vi/vim, append following line to your ~/.vimrc file:
set
numberSave and close the file.
Jump to particular line number from a shell prompt, enter:
$ vi +linenumber file.c$
vi +300 initlib.c
A. Displaying line numbers under vi / vim can be very useful for debugging code errors and to improve overall readability of a program.
vi / vim show line number command
To display line numbers along the left side of a window, type any one of the following::set
numberor
:set
nu
(Fig.01:
Vi / Vim line numbers in action - click to enlarge image)
To turn off line number again enter the same command:
:set
nu!If you need number every time you start vi/vim, append following line to your ~/.vimrc file:
set
numberSave and close the file.
Jump to particular line number from a shell prompt, enter:
$ vi +linenumber file.c$
vi +300 initlib.c
相关文章推荐
- How to replace a character for a newline in Vim?
- How to set the bash display to not show the vim text after exit?
- the way to compart a long code line into parts in order to make the Horizontal scroll bar disappear in V.S' Text Editor
- How to show line number in eclipse
- Show line numbers by default in Vim
- Linux - How to remove the new line at the end of file when using vim
- Units Problem: How to read text size as custom attr from xml and set it to TextView in java code
- How to Take Control of Your Line Height in Outlook.com
- how to show html code in html page
- How to show 3D object (.3DS or .MAX) in MATLAB using JMonkey
- [原] XAF How to see and edit the time part in the DatePropertyEditor for the System.DateTime property
- How to use isInEditMode() to see layout with custom View in the editor
- How to get app icon badge numbers in iOS7 without push notifications
- how to solve vim settings like highlight in iOS
- Siebel HOW TO: How to change log level in command-line
- How to get files to show up in the Process Monitor/Report Repository
- How to monitor Nginx web server from the command line in real time
- How do I convert from BLOB to TEXT in Mysql?
- How to find a file or folder in MS-DOS or Windows command line
- Siebel HOW TO: How to change log level in command-line