当前位置:网站首页>Basic use of vim - bottom line mode
Basic use of vim - bottom line mode
2022-07-31 23:34:00 【HUAWEI CLOUD】
vim bottom line mode command set
Before using the last line mode, please remember to press the "ESC" key to make sure you are in normal mode, and then press the ":" colon to enter the last line mode
- List line numbers
- “set nu”: Entering “set nu” will list the line number before each line in the file
- set nonu:cancel line number
- Jump to a line in the file
- “#”: The “#” sign represents a number, enter a number after the colon, and then press the Enter key to jump to the line, such as entering the number 15,
Press Enter again, it will jump to the lineto line 15 of the article
- “#”: The “#” sign represents a number, enter a number after the colon, and then press the Enter key to jump to the line, such as entering the number 15,
- Find character
- "/Keyword": Press the "/" key first, and then enter the character you want to find. If the keyword you are looking for the first time is not what you want, you can keep pressing
"n" will go backFind the keyword you want. - "?Keyword": Press the "?" key first, then enter the character you want to search for, if the keyword you are looking for is not what you want, you can keep
Press "n" to go forwardFind the keyword you want.
- "/Keyword": Press the "/" key first, and then enter the character you want to find. If the keyword you are looking for the first time is not what you want, you can keep pressing
- Save the file
- "w": Enter the letter "w" in the colon to save the file
- Leaving vim
- "q": Press "q" to exit, if you can't leave vim, you can forcefully leave vim after "q" followed by a "!"
- "wq": It is generally recommended to use it with "w" when leaving, so that the file can be saved when exiting
- Force turn !
- w! Force Quit
- wq! Force save and exit
- q! Force save
- vs file: multi-file operation [ctrl+w+w]
How to split screen left and right:
In the bottom line mode,
vs file name
can be continuously split screen, split screen to the left, if the file name after vs does not exist, it will be created by default and then opened
How to switch screens quickly:
Press
in bottom line modectrl +w +w
Where the cursor flashes, it means which file is selected. Enter wq in the bottom line mode of the file to save and exit, and the other file is retained.
Bulk Annotation and Bulk De-annotation
Batch comments:
In command mode: ctrl + v
Then use l,j,k,h
to select the area, then press the capital I
,will jump to the first position, enter the //
comment, then press the esc key
Batch de-comment:
In command mode: ctrl + v
Then use l,j,k,h
to select the area, note: to select two //
then lowercase i
, then d
边栏推荐
猜你喜欢
随机推荐
高等代数_证明_任何矩阵都相似于一个上三角矩阵
VOT2021 game introduction
SQL injection Less42 (POST type stack injection)
浏览器下载快捷方式到桌面(PWA)
Unity - by casting and cloning method dynamic control under various UGUI create and display
日常--Kali开启SSH(详细教程)
网络安全--通过握手包破解WiFi(详细教程)
什么时候可以使用 PushGateway
周总结
Usage of mysql having
What is customer profile management?
[QNX Hypervisor 2.2用户手册]9.16 system
Shell common scripts: Nexus batch upload local warehouse enhanced version script (strongly recommended)
无状态与有状态的区别
信奥学习规划 信息学竞赛之路(2022.07.31)
【MATLAB项目实战】LDPC-BP信道编码
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
内核对设备树的处理
@JsonFormat(pattern="yyyy-MM-dd") time difference problem
Fixed-length usage of nanopb string type based on RT1052 Aworks (27)