当前位置:网站首页>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 aWait to enter the input mode ;Input
:You can enter the baseline command modeThe input mode
except
EscOut of bond , Other keys are input ;Press
EscKey to exit the input mode , Enter command mode .last line node
Operation command with
enterEnd the baseline command mode ;Press
EscKey to exit the input mode , Enter command mode .
2. Introduction to commands in different modes
2.1 Command mode
Move the cursor
0Numbers 0, Move to the first character of this line$Move to the last character of this lineGMove to the last line of this filenGn Integers , Move to this file n That's okggMove to the first line of this file , amount to1Gn<Enter>n Integers , Subject to the current behavior , Move down the n That's okSearch for replacement *
/wordSearch under the cursor for a name word StringnContinue to find the content of the search string in the previous stepNContinue to look up the search string content of the previous stepCopy 、 Paste and delete **
x,Xx Indicates that the cursor is deleted The last character ;X Indicates that the cursor is deleted Previous characterddDelete the current line of the cursornddn Integers , Delete the downward position of the cursor n That's ok ( Start with the line where the cursor is )yyCopy the current line of the cursornyyn Integers , Copy cursor down n That's ok ( Start with the line where the cursor is )p,Pp To paste the copied data to the next line under the cursor , P Is pasted onto the upper line of the cursoruRecover the previous actionCtrl+rRedo the previous action.decimal point , Repeat the previous action
2.2 Relevant buttons for switching from command mode to input mode
Enter input mode
iEnter... From the current cursorIEnteraStart at the next character where the current cursor isAEnter at the last character of the current lineoLowercase letters o, At the current cursor Enter a new line at the next lineOCapital o, Enter a new line on the previous line where the current cursor isEnter substitution mode
rReplace a character where the cursor isRAlways replace the text where the cursor is , Until pressed ESC untilExit input mode
EscExit 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
:wSave changes:qsign out vi Edit mode:wqSave the changes and exit vi Edit modeZZCapital 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 nuAccording to the line Numbers:set nonuCancel the display line number
Reference documents
边栏推荐
- 页面关闭前,如何发送一个可靠请求
- 通过Go语言创建CA与签发证书
- Redis getting started complete tutorial: Geo
- Redis démarrer le tutoriel complet: Pipeline
- 攻防世界 MISC 進階區 Erik-Baleog-and-Olaf
- 堆排序代码详解
- 【ODX Studio编辑PDX】-0.2-如何对比Compare两个PDX/ODX文件
- SQL中MAX与GREATEST的区别
- Unity Xiuxian mobile game | Lua dynamic sliding function (specific implementation of three source codes)
- 攻防世界 MISC 进阶 glance-50
猜你喜欢

Redis getting started complete tutorial: publish and subscribe

On-off and on-off of quality system construction

攻防世界 misc 进阶区 2017_Dating_in_Singapore

Redis入门完整教程:有序集合详解

PMO: compare the sample efficiency of 25 molecular optimization methods

新版判断PC和手机端代码,手机端跳转手机端,PC跳转PC端最新有效代码

Li Kou 98: verify binary search tree

Redis getting started complete tutorial: Geo
![[roommate learned to use Bi report data processing in the time of King glory in one game]](/img/06/22dde3fcc0456bd230e1d0cde339ec.png)
[roommate learned to use Bi report data processing in the time of King glory in one game]

共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
随机推荐
攻防世界 MISC 进阶区 3-11
Redis入门完整教程:Redis使用场景
【ODX Studio编辑PDX】-0.2-如何对比Compare两个PDX/ODX文件
NFT insider 64: e-commerce giant eBay submitted an NFT related trademark application, and KPMG will invest $30million in Web3 and metauniverse
Sword finger offer 67 Convert a string to an integer
【剑指offer】1-5题
企业如何跨越数字化鸿沟?尽在云原生2.0
mamp下缺少pcntl扩展的解决办法,Fatal error: Call to undefined function pcntl_signal()
How to send a reliable request before closing the page
Redis getting started complete tutorial: publish and subscribe
[ODX studio edit PDX] - 0.2-how to compare two pdx/odx files of compare
Redis introduction complete tutorial: client communication protocol
Notepad++--编辑的技巧
剑指 Offer 65. 不用加减乘除做加法
Business is too busy. Is there really no reason to have time for automation?
Redis的持久化机制
攻防世界 MISC 進階區 Erik-Baleog-and-Olaf
9 - class
Close system call analysis - Performance Optimization
Redis入门完整教程:慢查询分析