2019独角兽企业重金招聘Python工程师标准>>>
Vim 行号的显示与隐藏
一、当前文档的显示与隐藏
1 打开一个文档
[root@pcname ~]# vim demo.txt
This is the main Apache HTTP server configuration file. It contains the
configuration directives that give the server its instructions.
See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
In particular, see
<URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
for a discussion of each configuration directive.
2 显示行号 vim 命令 :set number
或者 :set nu
1 2 This is the main Apache HTTP server configuration file. It contains the3 configuration directives that give the server its instructions.4 See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.5 In particular, see********为了两位娄行号效果并节省篇幅,此处省略几行********16 with "/", the value of ServerRoot is prepended -- so 'log/access_log'17 with ServerRoot set to '/www' will be interpreted by the18 server as '/www/log/access_log', where as '/log/access_log' will be19 interpreted as '/log/access_log'.20
3 隐藏行号 vim 命令 :set nonumber
或者 :set nonu
即可隐藏
二、所有文档行号的显示与隐藏
根据需求去配置当前用户和所有用户
/etc/vimrc 是系统范围的初始化配置
~/.vimrc 个人的vim初始化配置
以当前用户为列
vim ~/.vimrc
我们在配置文件输入set number 或者 set nu 保存即可
参考文档:wang_yubin92