当前位置:网站首页>vim命令下显示行号[通俗易懂]
vim命令下显示行号[通俗易懂]
2022-07-28 10:48:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
vim默认不显示行号
如何使vim命令显示行号?
显示当前行行号
在vim的命令模式下,在光标 停留处,退出命令模式,然后输入 :nu ,即可显示当前这行的号码
显示所有行号
如果要显示该文件的所有行号,则需要在vim的命令模式下,输入 :set nu ,则可以显示该文件的所有行号
取消所有行号
如果要显示该文件的所有行号,则需要在vim的命令模式下输入,在光标 停留处,退出命令模式,然后输入 :set nonu ,即可显示当前这行的号码
这样的设置方法只能维持在,当前vim打开的文件中显示效果,下次重新打开的时候又是无效的
如何vim下面永久性的显示行号呢?
那么我们怎么让我们每次打开vim的时候自动设置行号呢,这个时候就需要我们设置配置文件,两种配置方式
/etc/vimrc 是系统范围的初始化配置
~/.vimrc 个人的vim初始化配置
我们这里设置的是个人配置,直接在终端输入 vim ~/.vimrc ,然后我们就可以进入配置文件
使用vi编辑~/.vimrc文件或者/etc/vimrc文件,在该文件中加入一行”set nu”,添加内容不含引号, 命令如下:
然后输入 :wq保存文件并退出
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128284.html原文链接:https://javaforall.cn
边栏推荐
- Relevant knowledge points of hash table
- JS - modify the key name of the object in the array
- Under the platform driven platform, the "dev- > dev.of_node" of the formal parameter dev in the probe function Understanding of
- 机器学习强基计划0-5:为什么学习的本质是泛化能力?
- The use of C language linked list
- 18 diagrams, intuitive understanding of neural networks, manifolds and topologies
- 关于结构体指针函数的返回值传递给结构体指针的理解
- Tree shaking and DCE
- CGAL compilation error
- The blogs of excellent programmers at home and abroad are all here, please check it
猜你喜欢

Blue Bridge Cup embedded Hal library USART_ RX

为什么传输前要进行编码与调制

Machine learning strong foundation plan 0-5: why is the essence of learning generalization ability?
![Leetcode:981. time based key value storage [trap of iteration for: on]](/img/87/759594104d61bf787693544dd7152d.png)
Leetcode:981. time based key value storage [trap of iteration for: on]

这里有一份超实用Excel快捷键合集(常用+八大类汇总)

盘点:令人心动的数据可视化图表

适合中小企业的进销存软件,搞定5大难题

机器学习强基计划0-5:为什么学习的本质是泛化能力?

BC35 NB模块AT指令开发总结

What's the secret of creating a popular short video?
随机推荐
剑指 Offer 09. 用两个栈实现队列
19. Delete the penultimate node of the linked list
Inventory: exciting data visualization chart
BOM part attributes and understanding
【MySQL从入门到精通】【高级篇】(九)InnoDB的B+树索引的注意事项
盘点:6本书教会你职场晋升必备技能
1. Sum of two numbers
用手机对电脑进行远程关机
02.1.2. logic type bool
Eslint, eslint Chinese document
I use the applet container to improve the efficiency of mobile R & D by 5 times!
低代码十问:一文讲透关于低代码的一切!
Machine learning strong foundation plan 0-5: why is the essence of learning generalization ability?
什么是WordPress
Problems needing attention when VC links static libraries
Relevant knowledge points of hash table
不用Swagger,那我用啥?
Usage of memory operation functions memcpy() and memmove()
Installation points and precautions of split angle probe
低代码(aPaas)为什么最近又火了?