当前位置:网站首页>Configuration and basic use of vim
Configuration and basic use of vim
2022-07-27 18:01:00 【Massachusetts_ eleven】
1.vim Configuration of
default vim The editor is not indented , No line number , The interface is ugly …….
In order to get everyone started as soon as possible vim, Here is the shortest way to configure a user-friendly vim( Here is a target c/cpp The grammatical vim Editor configuration )
Copy and paste the following command into your linux, enter ( Be careful : For the vim To configure , Each user is independent , And can't give root The user configures )
curl -sLf https://gitee.com/HGtz2222/VimForCpp/raw/master/install.sh -o ./install.sh && bash ./install.sh
Input root password , enter
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-jdCudCff-1658757027050)(image-20220725212310676.png)]
perform
source ~/.bashrc, enter[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-nUs1vyF2-1658757027051)(image-20220725212600317.png)]
2.vim Use
Convenience , We put vim There are three modes : Command mode 、 Bottom line mode 、 Insertion mode


2.1 Command mode : Default mode
In command mode , Such words will appear in the lower left corner 
Any mode returns to command mode :esc
2.1.1 Text batch operation in command mode
2.1.1.1 Basic operation :
Duplicate a row :yy Copy 3 That's ok :3yy
Paste :p Paste 3 Time :3p
shear :dd
revoke :u
Restore :ctrl+r
2.1.1.2 Cursor movement :
Position the cursor on the end line :G Start line :gg Quickly position the cursor to the 3 That's ok :3G
Go to the end of the line :shift+4——$ Head of line :shift+6——^
Move the cursor in words - after :w front :b
The up and down or so :hjkl

2.1.1.3 Content modification
Reverse the case of the letters at the cursor :~
Replace the cursor with x:rx 3 individual x:3rx
Go to replace mode :R
Delete single characters :x Delete 3 individual :3x
2.2 Bottom line mode : Exit and other operations
Enter... In command mode : Enter bottom line mode
In bottom line mode , This state will appear in the lower left corner 
2.2.1 Common commands for bottom line mode
sign out :q
preservation :w
Save and exit :wq
Text substitution :s/xxxx/yyyyy/g( The full text of xxxx Switch to yyyyy)
confirm : enter
2.3 Insertion mode : Modify the content
In insertion mode , This state will appear in the lower left corner 
Enter... In command mode i/a/o Enter modify mode ;
i: Insert... From the cursor position
a: From the next position of the cursor
o: Insert a new line down
img-JubRJleH-1658757027056)]
Enter... In command mode i/a/o Enter modify mode ;
i: Insert... From the cursor position
a: From the next position of the cursor
o: Insert a new line down
边栏推荐
- General process of background management system permission setting
- Compilation and testing of raspberry pie driver code
- 卷积神经网络之卷积计算过程个人理解
- Likeshop takeout ordering system "100% open source without encryption"
- Coca Cola's primary challenge is not vitality forest
- 工信部再治数据安全,网易易盾“隐私合规”守住企业经营底线
- 【单片机】2.3 AT89S52的CPU
- PostgreSQL 14 支持winserver2022吗?
- 知物由学 | SO加固如何提升Android应用的安全性?
- [OBS] newsocketloopenable network optimization
猜你喜欢

卷积神经网络之卷积计算过程个人理解

Learn from what you know | Yidun self-developed text real-time clustering technology, and wipe out the same kind of harmful content in social networks

笔试缺考者入围教师招聘面试?河南祥符:个别考生成绩统计错误

工信部再治数据安全,网易易盾“隐私合规”守住企业经营底线
![[MCU] 2.2 pin function of AT89S52](/img/d0/b204efb80ec5f0b7bc2d83d0250eb9.png)
[MCU] 2.2 pin function of AT89S52

卷积神经网络——FPN(Feature Pyramid Networks)介绍

【obs】NewSocketLoopEnable 网络优化

Are those who are absent from the written examination shortlisted for the teacher recruitment interview? Henan Xiangfu: the statistics of individual candidates' scores are wrong

7月第4周易盾业务风控关注 | 最高法对APP强索个人信息进行规制

C语言怎么学?这篇文章给你完整答案
随机推荐
【数据库系统概论(王珊)】第4章——数据库安全性
卷积神经网络——YOLOV1论文翻译
Establishing SSL connection without server‘s identity verification is not recommended
写好技术原创文章的一点建议
卷积神经网络——FPN(Feature Pyramid Networks)介绍
#yyds干货盘点# 面试必刷TOP101:链表内指定区间反转
【数据库系统概论(王珊)】第5章——数据库完整性
Database hyperphone (III)
Branch loop statement of C language
Help, boost and take responsibility, the new value and significance of the 6th Tuba rabbit 718 national home decoration Festival
[introduction to database system (Wang Shan)] Chapter 5 - database integrity
Use @ in the project created by CRA, let it recognize the @ path and give path tips
Could not obtain transaction-synchronized Session for current thread
Explain the pile of binary trees in detail
An analysis of CPU explosion of a smart logistics WCS system in.Net
Does PostgreSQL 14 support winserver2022?
How to resolve the public domain name to the intranet IP server -- quickly resolve the domain name and map the Internet access
如何限制root远程登入,使普通用户拥有root权限
Wechat applet cloud function batch delete multiple data error: errcode: -502005 database collection not exists
Talk about the new trend of machine translation, and the second maverick translation forum is about to open