当前位置:网站首页>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
边栏推荐
- 北京突然宣布,元宇宙重大消息
- RTL8762DK 使用DebugAnalyzer(四)
- Introduction to machine learning how to?
- MYSQL索引解析
- GDB source code analysis series of articles five: dynamic library delay breakpoint implementation mechanism
- What practical projects can machine learning beginners learn?
- Automated machine learning pycaret: PyCaret Basic Auto Classification LightGBM
- 链式编程、包、访问权限
- MYSQL Classic Interview Questions
- date command
猜你喜欢
现代企业架构框架1
机器学习应该如何入门?
Euler system (euleros): upgrade Mysql
You need to know the TCP wave four times
SC7A20 (Silan Micro-Accelerometer) Example
STK8321 I2C(昇佳-加速度传感器)示例
MYSQL master-slave replication
MYSQL查询截取优化分析
Introduction to the five data types of Redis
Application of integrated stepper motor in UAV automatic airport
随机推荐
GDB 源码分析系列文章五:动态库延迟断点实现机制
RTL8762DK UART(二)
Automated machine learning pycaret: PyCaret Basic Auto Classification LightGBM
MYSQL逻辑架构
MYSQL logical architecture
MYSQL关键字Explain解析
链式编程、包、访问权限
High dimensional Gaussian distribution basics
Classes and Objects: Medium
Js replication
SC7A20 (Silan Micro-Accelerometer) Example
STK8321 I2C(昇佳-加速度传感器)示例
TCP协议详解
高维高斯分布基础
LeetCode每日一练 —— 环形链表问题(面试四连问)
Key Points Estimation and Point Instance
设计消息队列存储消息数据的MySQL表格
Blueprint: Yang Hui's Triangular Arrangement
Unity3D学习笔记10——纹理数组
Daily practice of LeetCode - Circular linked list question (interview four consecutive questions)