当前位置:网站首页>VIM basic operation summary
VIM basic operation summary
2022-07-25 13:18:00 【Just stay at home】
vim yes linux The next file editor , This article will focus on Summary Operation in normal mode and conversion between modes .
Catalog
One . Mode conversion and exit
Two . In normal mode vim Operation and split screen switching
( One ). In normal mode vim operation
( Two ). Split screen switching
One . Mode conversion and exit
( One ). Mode conversion
By default ,vim The editor is in normal mode (normal)

vim There are five basic patterns : Common mode 、 Insertion mode (insert)、 Replace mode (replace)、 Command mode (command)、 Visual Modes (visual).
The replacement is as follows :
| Ordinary -> Insert | i |
| Ordinary -> Replace | R |
| Ordinary -> command | : |
| Ordinary -> visual | v |
| Other modes -> Ordinary | Esc |
It is worth noting that , If we want to switch between two non ordinary modes , You need to switch to normal mode first and then switch accordingly .
You can use the following table to make a summary :

( Two ). sign out
Exit time , We will use command mode , In command mode :
| w | preservation | wq | Save and exit |
| q | sign out | w! | Force save |
| ! | mandatory | q! | Forced exit |

Press enter to exit .
Two . In normal mode vim Operation and split screen switching
( One ). In normal mode vim operation
In normal mode , We do not need to use the Enter key to carry out the command operation .
Be careful : The following can be omitted n, nothing n Everyone thinks 1.
| n yy | Copy from the cursor n That's ok . |
| n p | Paste from the next line under the cursor n Time . |
| n u | revoke n Secondary historical operation . |
| n ctrl r / ctrl R | Undo just now u operation . |
| n G | Position the cursor on the... Page n That's ok , nothing n Then set to the last line |
| n gg | Position the cursor on the... Page n That's ok , nothing n Then set to the first line |
| n w | The cursor moves to the right in units of words n individual . |
| n b | The cursor moves left in units of words n individual . |
| n $ / shift 4 | Count this line and move the cursor down 4 That's ok . nothing n The cursor moves to the rightmost column of the line |
| ^ / shift 6 | The cursor moves to the leftmost column of the line |
| n dd | take n Cut , It can also be deleted . |
| n r | Replace n Characters ( take n Replace characters with the same ). |
| n x | Delete n Characters ( From left to right ). |
| n X | Delete n Characters ( right to left ). |
| n ~ / shift ` | Raise the cursor n Character case conversion . |
( Two ). Split screen switching
Split screen switching needs to be carried out in command mode .
Vertical split screen :vs file
Horizontal split screen :sp file
Switch split screen :ctrl ww
vim Proceed under linux Command operation :! Instructions
Exit split screen :exit ( At this time, the file in which the cursor is located will exit )
- “ Fools are confused , Wise men ask questions .”—— Benjamin · Disraeli (Benjamin Disraeli)
If there is a mistake , Please correct
边栏推荐
- Excel添加按键运行宏
- 【AI4Code】CodeX:《Evaluating Large Language Models Trained on Code》(OpenAI)
- My creation anniversary
- Cyberspace Security penetration attack and defense 9 (PKI)
- 程序员成长第二十七篇:如何评估需求优先级?
- [six articles talk about scalablegnn] around www 2022 best paper PASCA
- 0719RHCSA
- 卷积神经网络模型之——GoogLeNet网络结构与代码实现
- ThreadLocal&Fork/Join
- Docekr learning - MySQL 8 master-slave replication setup deployment
猜你喜欢

Concurrent programming - memory model JMM

MLIR原理与应用技术杂谈

6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略

【视频】马尔可夫链原理可视化解释与R语言区制转换MRS实例|数据分享

好友让我看这段代码

程序的内存布局

Atcoder beginer contest 261e / / bitwise thinking + DP

【GCN-CTR】DC-GNN: Decoupled GNN for Improving and Accelerating Large-Scale E-commerce Retrieval WWW22

Generate SQL script file by initializing the latest warehousing time of vehicle attributes

Convolutional neural network model -- vgg-16 network structure and code implementation
随机推荐
【重温SSM框架系列】15 - SSM系列博文总结【SSM杀青篇】
若依如何实现用户免密登录配置方法?
0716RHCSA
OAuth, JWT, oidc, you mess me up
程序员成长第二十七篇:如何评估需求优先级?
Zero basic learning canoe panel (12) -- progress bar
Substance Designer 2021软件安装包下载及安装教程
In order to improve efficiency, there are various problems when using parallelstream
VIM tip: always show line numbers
深度学习的训练、预测过程详解【以LeNet模型和CIFAR10数据集为例】
Zero basic learning canoe panel (14) -- led control and LCD control
外围系统调用SAP的WebAPI接口
【CSDN 年终总结】结束与开始,一直在路上—— “1+1=王”的2021总结
Oran special series-21: major players (equipment manufacturers) and their respective attitudes and areas of expertise
Programmer growth chapter 27: how to evaluate requirements priorities?
Date and time function of MySQL function summary
arm架构移植alsa-lib和alsa-utils一路畅通
Esp32-c3 is based on blinker lighting control 10 way switch or relay group under Arduino framework
Shell常用脚本:检测某域名、IP地址是否通
Excel录制宏