当前位置:网站首页>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
边栏推荐
- Attack and defense world misc advanced grace-50
- Redis入门完整教程:列表讲解
- The table is backed up in ODPs. Why check m in the metabase_ Table, the logical sizes of the two tables are inconsistent, but the number of
- [cooking record] - stir fried 1000 pieces of green pepper
- NFT insider 64: e-commerce giant eBay submitted an NFT related trademark application, and KPMG will invest $30million in Web3 and metauniverse
- Redis入门完整教程:事务与Lua
- 该如何去选择证券公司,手机上开户安不安全
- Naacl-22 | introduce the setting of migration learning on the prompt based text generation task
- Lost in the lock world of MySQL
- Photoshop批量给不同的图片添加不同的编号
猜你喜欢
P2181 对角线和P1030 [NOIP2001 普及组] 求先序排列
MySQL Architecture - user rights and management
A complete tutorial for getting started with redis: redis shell
sobel过滤器
Explanation of bitwise operators
Google Earth engine (GEE) - tasks upgrade enables run all to download all images in task types with one click
位运算符讲解
Redis入门完整教程:Bitmaps
Persistence mechanism of redis
The sandbox has reached a cooperation with digital Hollywood to accelerate the economic development of creators through human resource development
随机推荐
Attack and defense world misc advanced area Hong
Redis introduction complete tutorial: client communication protocol
Redis入门完整教程:Pipeline
Sobel filter
Google Earth Engine(GEE)——以MODIS/006/MCD19A2为例批量下载逐天AOD数据逐天的均值、最大值、最小值、标准差、方差统计分析和CSV下载(北京市各区为例)
MYSQL架构——用户权限与管理
【机器学习】手写数字识别
攻防世界 misc 进阶区 2017_Dating_in_Singapore
Redis introduction complete tutorial: slow query analysis
leetcode 72. Edit distance edit distance (medium)
On-off and on-off of quality system construction
浅聊一下中间件
9 - class
攻防世界 MISC 进阶区 3-11
A complete tutorial for getting started with redis: transactions and Lua
云服务器设置ssh密钥登录
Mongodb aggregation operation summary
Complete tutorial for getting started with redis: bitmaps
Redis入门完整教程:Bitmaps
Google Earth engine (GEE) - globfire daily fire data set based on mcd64a1