首页 > 系统服务 > 详细

Vim显示行号

时间:2015-04-03 17:00:57      阅读:320      评论:0      收藏:0      [点我收藏+]

If you need number every time you start vi/vim, append following line to your ~/.vimrc file:

vi ~/.vimrc

 


Append the following line:

set number

 


Save and close the file.

 

Tip: Open a file at particular location/line number

Jump to particular line number from a shell prompt, enter:

$ vi +linenumber file.c
$ vi +300 initlib.c 

 


Jump to particular line that contains main() function from a shell prompt, enter:

$ vi +/searchTermHere file.c
$ vi +/main initlib.c
### note shell escape done with \ ###
$ vi +/addUser\( initlib.c
$ vi +/addUser\(arg1\) initlib.c

 

http://www.cyberciti.biz/faq/vi-show-line-numbers/

Vim显示行号

原文:http://www.cnblogs.com/bitter/p/4390397.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!