当前位置:网站首页>Simple vim configuration
Simple vim configuration
2022-08-01 01:19:00 【HUAWEI CLOUD】
do not exit vim manual man
How to view the manual without exiting vim?
In the bottom line mode: !man query content Press q to exit and return to vim
Example: !man fork
Simple vim configuration
Users will only affect their own (user) operations in the configuration file of vim
root has its own vim configuration file, which will only affect itself (root)
Summary: only affects myself
Location of configuration file:
- Under the directory /etc/, there is a file named vimrc, which is the public vim configuration file in the system and is valid for all users.
- In each user's home directory, they can create their own private configuration file named: ".vimrc"
- For example, in the /root directory, a .vimrc file usually already exists. If it does not exist, it will be created
- Switch the user to be yourself and execute
su, enter your own main working directory, and executecd ~ - Open the .vimrc file in your own directory and execute vim .vimrc

Note: To create a .vimrc file in your own working directory (~)
The most basic vim configuration is written in the .vimrc file. To configure vim, you only need to add content to the .vimrc file
Common configuration options
Just write the corresponding content in the .vimrc file:
Example:
- Set syntax highlighting: syntax on
- Display line number: set nu
- Set the number of indent spaces to 4: set shiftwidth=4
Auto configure vim:
Enter the following command directly
curl -sLf https://gitee.com/HGtz2222/VimForCpp/raw/master/install.sh -o ./install.sh&& bash ./install.sh
Then follow the prompts to enter the root password, then wait for the installation configuration, and finally manually execute source ~/.bashrc.After the configuration is complete, functions such as auto-completion, line number display, and auto-indentation are available
Add user to trusted list
- You need to operate under the root user first
- Modify the content of the file:
vim /etc/suduers - Scroll down to the specific location, in insert mode, add the user to the trust list according to the format

边栏推荐
- 现代企业架构框架1
- Web3.0: Building an NFT Market (1)
- cmake入门学习笔记
- 北京突然宣布,元宇宙重大消息
- Chinese version of Pylint inspection rules
- 软考高级系统架构设计师系列之:系统开发基础知识
- Unity3D study notes 10 - texture array
- Compose principle - the view and the principle of two-way data binding
- pycaret source code analysis: download dataset\Lib\site-packages\pycaret\datasets.py
- date command
猜你喜欢

元宇宙改变人类工作模式的四种方式

Team of Professor Chen Jianyu of Tsinghua University | Contact Safety Reinforcement Learning Framework Based on Contact-rich Robot Operation

MYSQL logical architecture

ECCV2022 Workshop | Multi-Object Tracking and Segmentation in Complex Environments

MYSQL查询截取优化分析

Euler system (euleros): upgrade Mysql

MYSQL Index Analysis

Basic implementation of vector

如何编辑epub电子书的目录

MYSQL two-phase commit
随机推荐
设备树的树形结构到底是怎样体现的?
修改Postman安装路径
[Microservice] Distributed Transaction Solution - Seata
device node结构体转换成platform_device结构体
Rasa 3.x 学习系列-使用查找表改进实体提取
VPGNet
ECCV2022 Workshop | 复杂环境中的多目标跟踪和分割
元宇宙改变人类工作模式的四种方式
【Cryptography/Cryptanalysis】Cryptanalysis method based on TMTO
Item 36: Specify std::launch::async if asynchronicity is essential.
Compose principle - the view and the principle of two-way data binding
Four ways the Metaverse is changing the way humans work
July Bootcamp (Day 31) - Status Compression
WebApi hits an Attribute to handle exceptions uniformly
设备树——dtb格式到struct device node结构体的转换
MYSQL Index Analysis
RTL8762DK PWM (seven)
Binary tree traversal non-recursive program -- using stack to simulate system stack
What practical projects can machine learning beginners learn?
解决IDEA默认情况下新建文件时,右击,new,没有XML文件的问题