当前位置:网站首页>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
边栏推荐
猜你喜欢

A complete tutorial for getting started with redis: transactions and Lua

Redis入門完整教程:Pipeline

攻防世界 MISC 进阶区 hong

【室友用一局王者荣耀的时间学会了用BI报表数据处理】

Hit the core in the advanced area of misc in the attack and defense world

【剑指offer】1-5题

浅聊一下中间件

Redis introduction complete tutorial: client communication protocol

Sobel filter

Google Earth engine (GEE) - globfire daily fire data set based on mcd64a1
随机推荐
The Sandbox 和数字好莱坞达成合作,通过人力资源开发加速创作者经济的发展
Redis getting started complete tutorial: Geo
通过Go语言创建CA与签发证书
攻防世界 MISC 进阶区 can_has_stdio?
Erik baleog and Olaf, advanced area of misc in the attack and defense world
【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
A complete tutorial for getting started with redis: hyperloglog
[machine learning] handwritten digit recognition
Redis入门完整教程:HyperLogLog
Unity修仙手游 | lua动态滑动功能(3种源码具体实现)
安装人大金仓数据库
[cooking record] - stir fried 1000 pieces of green pepper
Sword finger offer 65 Add without adding, subtracting, multiplying, dividing
Insert sort, select sort, bubble sort
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
Tla+ introductory tutorial (1): introduction to formal methods
Unity vscode emmylua configuration error resolution
Business is too busy. Is there really no reason to have time for automation?
特征缩放 标准化 归一化