当前位置:网站首页>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
边栏推荐
- Feature scaling normalization
- Complete tutorial for getting started with redis: bitmaps
- The sandbox has reached a cooperation with digital Hollywood to accelerate the economic development of creators through human resource development
- Detailed explanation of heap sort code
- Attack and Defense World MISC Advanced Area Erik baleog and Olaf
- Photoshop批量给不同的图片添加不同的编号
- 常用技术指标之一文读懂BOLL布林线指标
- A complete tutorial for getting started with redis: transactions and Lua
- 新版判断PC和手机端代码,手机端跳转手机端,PC跳转PC端最新有效代码
- 华泰证券是国家认可的券商吗?开户安不安全?
猜你喜欢
Redis入门完整教程:慢查询分析
Attack and defense world misc advanced area ditf
攻防世界 MISC 进阶区 hong
攻防世界 MISC 进阶 glance-50
常用技术指标之一文读懂BOLL布林线指标
Redis入门完整教程:Redis Shell
质量体系建设之路的分分合合
Breakpoint debugging under vs2019 c release
Redis démarrer le tutoriel complet: Pipeline
Close system call analysis - Performance Optimization
随机推荐
【lua】int64的支持
云服务器设置ssh密钥登录
One of the commonly used technical indicators, reading boll Bollinger line indicators
Unity修仙手游 | lua动态滑动功能(3种源码具体实现)
Redis démarrer le tutoriel complet: Pipeline
Redis入门完整教程:初识Redis
[roommate learned to use Bi report data processing in the time of King glory in one game]
Install the gold warehouse database of NPC
Erik baleog and Olaf, advanced area of misc in the attack and defense world
[ODX studio edit PDX] - 0.2-how to compare two pdx/odx files of compare
Redis入门完整教程:Redis Shell
On-off and on-off of quality system construction
MD5 tool class
The overview and definition of clusters can be seen at a glance
Unity-VScode-Emmylua配置报错解决
The Sandbox 和数字好莱坞达成合作,通过人力资源开发加速创作者经济的发展
通过Go语言创建CA与签发证书
剑指Offer 68 - II. 二叉树的最近公共祖先
页面关闭前,如何发送一个可靠请求
[cooking record] - stir fried 1000 pieces of green pepper