当前位置:网站首页>VIM editor knowledge summary
VIM editor knowledge summary
2022-07-04 22:58:00 【Song Xiaoyu】
1. Three models
Input vi/vim <filename>
You can enter a file ( Whether this file exists or not ) Command mode of , Input wq
Wait for the baseline command to exit the file command mode .
Schematic diagram of working mode
Command mode
Input
i o a
Wait to enter the input mode ;Input
:
You can enter the baseline command modeThe input mode
except
Esc
Out of bond , Other keys are input ;Press
Esc
Key to exit the input mode , Enter command mode .last line node
Operation command with
enter
End the baseline command mode ;Press
Esc
Key to exit the input mode , Enter command mode .
2. Introduction to commands in different modes
2.1 Command mode
Move the cursor
0
Numbers 0, Move to the first character of this line$
Move to the last character of this lineG
Move to the last line of this filenG
n Integers , Move to this file n That's okgg
Move to the first line of this file , amount to1G
n<Enter>
n Integers , Subject to the current behavior , Move down the n That's okSearch for replacement *
/word
Search under the cursor for a name word Stringn
Continue to find the content of the search string in the previous stepN
Continue to look up the search string content of the previous stepCopy 、 Paste and delete **
x,X
x Indicates that the cursor is deleted The last character ;X Indicates that the cursor is deleted Previous characterdd
Delete the current line of the cursorndd
n Integers , Delete the downward position of the cursor n That's ok ( Start with the line where the cursor is )yy
Copy the current line of the cursornyy
n Integers , Copy cursor down n That's ok ( Start with the line where the cursor is )p,P
p To paste the copied data to the next line under the cursor , P Is pasted onto the upper line of the cursoru
Recover the previous actionCtrl+r
Redo the previous action.
decimal point , Repeat the previous action
2.2 Relevant buttons for switching from command mode to input mode
Enter input mode
i
Enter... From the current cursorI
Entera
Start at the next character where the current cursor isA
Enter at the last character of the current lineo
Lowercase letters o, At the current cursor Enter a new line at the next lineO
Capital o, Enter a new line on the previous line where the current cursor isEnter substitution mode
r
Replace a character where the cursor isR
Always replace the text where the cursor is , Until pressed ESC untilExit input mode
Esc
Exit input mode , Go back to command mode
2.3 Switch the command mode to the bottom line command mode
Commands such as saving and exiting files
:w
Save changes:q
sign out vi Edit mode:wq
Save the changes and exit vi Edit modeZZ
Capital letters z, Equate to:wq
, Save the changes and exit vi Edit mode:<>!
Add... After the order!
Number , Indicates a forced operationLine number display operation
:set nu
According to the line Numbers:set nonu
Cancel the display line number
Reference documents
边栏推荐
- Redis入门完整教程:GEO
- 剑指 Offer 67. 把字符串转换成整数
- UML图记忆技巧
- Gnawing down the big bone - sorting (II)
- Solana chain application crema was shut down due to hacker attacks
- MYSQL架构——用户权限与管理
- Unity Xiuxian mobile game | Lua dynamic sliding function (specific implementation of three source codes)
- Create Ca and issue certificate through go language
- Google Earth Engine(GEE)——基于 MCD64A1 的 GlobFire 日常火灾数据集
- Explanation of bitwise operators
猜你喜欢
攻防世界 MISC 进阶区 3-11
Detailed explanation of heap sort code
Redis入门完整教程:有序集合详解
Redis入門完整教程:Pipeline
攻防世界 misc 高手进阶区 a_good_idea
Close system call analysis - Performance Optimization
Redis getting started complete tutorial: publish and subscribe
Attack and defense world misc advanced area ditf
攻防世界 MISC 进阶区 Erik-Baleog-and-Olaf
Redis introduction complete tutorial: slow query analysis
随机推荐
堆排序代码详解
Redis入门完整教程:事务与Lua
Close system call analysis - Performance Optimization
[cooking record] - stir fried 1000 pieces of green pepper
sobel过滤器
Redis入门完整教程:列表讲解
EditPlus--用法--快捷键/配置/背景色/字体大小
Redis入门完整教程:Redis使用场景
Mongodb aggregation operation summary
云服务器设置ssh密钥登录
攻防世界 MISC 进阶区 Ditf
浅聊一下中间件
质量体系建设之路的分分合合
Redis入门完整教程:客户端通信协议
NFT insider 64: e-commerce giant eBay submitted an NFT related trademark application, and KPMG will invest $30million in Web3 and metauniverse
剑指 Offer 67. 把字符串转换成整数
Is Huatai Securities a nationally recognized securities firm? Is it safe to open an account?
Google Earth Engine(GEE)——以MODIS/006/MCD19A2为例批量下载逐天AOD数据逐天的均值、最大值、最小值、标准差、方差统计分析和CSV下载(北京市各区为例)
[the 2023 autumn recruitment of MIHA tour] open [the only exclusive internal push code of school recruitment eytuc]
Detailed explanation of heap sort code