当前位置:网站首页>简单的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 - 下翻到具体位置,在插入模式下,按格式把用户添加到信任列表

边栏推荐
- SQL注入 Less46(order by后的注入+rand()布尔盲注)
- thymeleaf迭代map集合
- SQL注入 Less38(堆叠注入)
- [Reading Notes -> Data Analysis] 02 Data Analysis Preparation
- 助力数字政府建设,中科三方构建域名安全保障体系
- 内核对设备树的处理
- Drawing process of hand-drawn map of scenic spots
- The uniapp applet checks and prompts for updates
- 编写方法将一个数组扁平化并且去重和递增排序
- Network security - crack WiFi through handshake packets (detailed tutorial)
猜你喜欢
![[Cloud Residency Co-Creation] [HCSD Big Celebrity Live Broadcast] Personally teach the secrets of interviews in big factories](/img/7a/278ffada1cc660e7f5c2d7c66fa38e.png)
[Cloud Residency Co-Creation] [HCSD Big Celebrity Live Broadcast] Personally teach the secrets of interviews in big factories

Federated Learning: Multi-source Knowledge Graph Embedding in Federated Scenarios

新产品如何进行网络推广?

Collation of knowledge points in Ningbo University NBU IT project management final exam

Daily--Kali opens SSH (detailed tutorial)

【Acwing】The 62nd Weekly Game Solution

逐步手撕轮播图3(保姆级教程)
SQL27 View user details of different age groups

嵌入式开发没有激情了,正常吗?

网络安全--通过握手包破解WiFi(详细教程)
随机推荐
【Acwing】第62场周赛 题解
Flutter教程之 02 Flutter 桌面程序开发入门教程运行hello world (教程含源码)
NgRx 里 first 和 take(1) 操作符的区别
Pytest first experience
Thinking and Implementation of Object Cache Service
A high-quality WordPress download site template theme developed abroad
Usage of mysql having
thymeleaf迭代map集合
一文带你了解 Grafana 最新开源项目 Mimir 的前世今生
基于单片机GSM的防火防盗系统的设计
Niuke.com brush questions (1)
标段参数说明
SQL27 View user details of different age groups
二叉树非递归遍历
VOT2021 game introduction
数据分析(一)——matplotlib
支付模块实现
《ArchSummit:时代的呐喊,技术人听得到》
SQL injection Less42 (POST type stack injection)
Shell common script: Nexus batch upload local warehouse script