当前位置:网站首页>简单的vim配置
简单的vim配置
2022-07-31 23:23:00 【华为云】
不退出vim使用手册man
如何不退出vim查看手册?
在底行模式下: !man 查询内容 按q退出,回到vim当中
例子: !man fork
简单vim配置
用户在配置vim的配置文件中,只会影响自己(用户)的操作
root有自己的vim配置文件,也只会影响自己(root)
总结:只会影响自己
配置文件的位置:
- 在目录 /etc/ 下面,有个名为vimrc的文件,这是系统中公共的vim配置文件,对所有用户都有效。
- 而在每个用户的主目录下,都可以自己建立私有的配置文件,命名为:“.vimrc”
- 例如,/root目录下,通常已经存在一个.vimrc文件,如果不存在,则创建之
- 切换用户成为自己执行
su,进入自己的主工作目录,执行cd ~ - 打开自己目录下的.vimrc文件,执行 vim .vimrc

注意:要在自己的工作目录(~)下创建.vimrc文件
最基本的vim的配置都写在.vimrc文件中,想要配置vim,只需要在.vimrc文件中添加内容即可
常用配置选项
只需在.vimrc文件中写入对应的内容即可:
如:
- 设置语法高亮: syntax on
- 显示行号: set nu
- 设置缩进的空格数为4: set shiftwidth=4
自动配置vim:
直接输入如下命令
curl -sLf https://gitee.com/HGtz2222/VimForCpp/raw/master/install.sh -o ./install.sh && bash ./install.sh
然后按照提示输入root密码,然后等待安装配置,最后手动执行source ~/.bashrc。配置完成后,类似自动补全、行号显示以及自动缩进等功能就有了
把用户加入到信任列表中
- 首先需要在root用户下操作
- 修改文件的内容:
vim /etc/suduers - 下翻到具体位置,在插入模式下,按格式把用户添加到信任列表

边栏推荐
- @JsonFormat(pattern="yyyy-MM-dd") time difference problem
- 博弈论(Depu)与孙子兵法(42/100)
- 基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
- 「APIO2010」巡逻 题解
- mysql having的用法
- Shell common scripts: Nexus batch upload local warehouse enhanced version script (strongly recommended)
- SQL injection Less42 (POST type stack injection)
- 基于单片机GSM的防火防盗系统的设计
- 信奥学习规划 信息学竞赛之路(2022.07.31)
- Program processes and threads (concurrency and parallelism of threads) and basic creation and use of threads
猜你喜欢

消息队列消息存储设计(架构实战营 模块八作业)
![[Reading Notes -> Data Analysis] 02 Data Analysis Preparation](/img/e7/258daf851746cb043f301437ee3bbe.png)
[Reading Notes -> Data Analysis] 02 Data Analysis Preparation

/etc/sysconfig/network-scripts 配置网卡
不知道该怎么办的同步问题

The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#

SVN server construction + SVN client + TeamCity integrated environment construction + VS2019 development

Unity - LineRenderer show a line

Shell常用脚本:Nexus批量上传本地仓库脚本

The article you worked so hard to write may not be your original

基于simulink的Passive anti-islanding-UVP/OVP and UFP/OFP被动反孤岛模型仿真
随机推荐
Fixed-length usage of nanopb string type based on RT1052 Aworks (27)
Dry goods | 10 tips for MySQL add, delete, change query performance optimization
[QNX Hypervisor 2.2用户手册]9.16 system
Binary tree non-recursive traversal
Advanced Algebra _ Proof _ Any matrix is similar to an upper triangular matrix
C# Rectangle basic usage and picture cutting
VOT2021比赛简介
对象缓存服务的思考和实现
Handwritten a simple web server (B/S architecture)
SQL注入 Less47(报错注入) 和Less49(时间盲注)
SQL注入 Less38(堆叠注入)
Learn about C# anonymous methods
mysql having的用法
消息队列存储消息数据的MySQL表格
10大主流3D建模技术
"APIO2010" Patrol Problem Solution
字符编码和浮点型计算精度丢失问题
浏览器下载快捷方式到桌面(PWA)
hboot与recovery、boot.img、system.img
hboot and recovery, boot.img, system.img