当前位置:网站首页>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
边栏推荐
- echo -ne(echo line)
- c语言实现float型数据转成BCD数据
- RHEL 6.4 installing SVN and Apache
- Ec20/ec25 4G module at instruction development summary
- Relevant knowledge points of hash table
- cortex-M4与cortex-A7内核启动流程分析
- Sword finger offer 35. replication of complex linked list
- Nodejs: mongodb simple fuzzy + paging query instance
- Build a quick development ide: visualsvn + sublime + Visual Studio 2013 + quickeasyftpserver
- JWT login authentication + token automatic renewal scheme, well written!
猜你喜欢

Relevant knowledge points of hash table

不用Swagger,那我用啥?

大三下学期总结

一文学会如何做电商数据分析(附运营分析指标框架)

字节一面:如何用 UDP 实现可靠传输?

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

GIS数据漫谈(五)— 地理坐标系统

Remote shutdown of computer with mobile phone
![Leetcode:1300. the sum of the array closest to the target value after transforming the array [dichotomy]](/img/da/51c4051464d52eae10d93e881cfdf5.png)
Leetcode:1300. the sum of the array closest to the target value after transforming the array [dichotomy]

用 ZEGO Avatar 做一个虚拟人|虚拟主播直播解决方案
随机推荐
offsetof宏与container_of宏分析详解
Two dimensional prefix and
[MySQL from introduction to proficiency] [advanced chapter] (IX) precautions for InnoDB's b+ tree index
Do data analysis, do you still not understand RFM analysis method (model)?
理解Oracle的几个概念
Eslint, eslint Chinese document
Nodejs: mongodb simple fuzzy + paging query instance
2021-03-24
_ HUGE and __ IMP__ HUGE in “math.h“
Sword finger offer 06. print linked list from end to end
学会这些分析方法及模型,遇到问题不再没思路
Use the statement object to execute DDL statements to create tables
1. Sum of two numbers
【MySQL从入门到精通】【高级篇】(九)InnoDB的B+树索引的注意事项
EC20/EC25 4G模块AT指令开发总结
构建快捷开发IDE:VisualSVN+Sublime+Visual Studio 2013+QuickEasyFTPServer
剑指 Offer 30. 包含min函数的栈
不用Swagger,那我用啥?
Cortex-M内核管理全局中断的三种方式
Table data processing software, what else besides excel?