当前位置:网站首页>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
边栏推荐
猜你喜欢
Blueprint: Yang Hui's Triangular Arrangement
Team of Professor Chen Jianyu of Tsinghua University | Contact Safety Reinforcement Learning Framework Based on Contact-rich Robot Operation
SC7A20 (Silan Micro-Accelerometer) Example
How to get started with YOLO?How to implement your own training set?
【数据分析】基于matlab GUI学生成绩管理系统【含Matlab源码 1981期】
Daily practice of LeetCode - Circular linked list question (interview four consecutive questions)
STK8321 I2C(昇佳-加速度传感器)示例
机器学习应该如何入门?
微信小程序之小程序页面语法
数据中台建设(七):数据资产管理
随机推荐
Luogu P3373: Segment tree
Super like the keyboard made from zero, IT people love it
Nmap 操作手册 - 完整版
Rasa 3.x 学习系列-使用查找表改进实体提取
Nmap Operation Manual - Full Version
Application of integrated stepper motor in UAV automatic airport
What practical projects can machine learning beginners learn?
Exam preparation plan
RTL8762DK 使用DebugAnalyzer(四)
链式编程、包、访问权限
/usr/sbin/vmware-authdlauncher: error while loading shared libraries: libssl.so.1.0.2*解决办法
Inheritance Considerations
Rasa 3.x Learning Series - Using Lookup Tables to Improve Entity Extraction
高维高斯分布基础
Design the message queue storage MySQL form of message data
MYSQL经典面试题
RTL8762DK PWM (seven)
leetcode:1562. 查找大小为 M 的最新分组【模拟 + 端点记录 + 范围合并】
现代企业架构框架1
ROS2 series of knowledge (4): understand the concept of [service]