当前位置:网站首页>Basic operation of vim
Basic operation of vim
2022-07-27 05:09:00 【Code loving students】
Catalog
3. vim Command mode command set
1. vim Basic concepts of
vim There are three main modes: :
- Command mode : Control the movement of the screen cursor , character 、 The deletion of words or lines , Move to copy a section and enter Insert mode Next , Or to last line mode
- Bottom line mode : Only in Insert mode Next , To input text , Press 「ESC」 Key to return to command line mode . This mode is the most frequently used later The editing mode of .
- Insertion mode : File save or exit , You can also replace files , Find string , List line number and other operations . In the command In mode ,shift+: You can enter the mold type . To see all your patterns : open vim, Bottom row mode straight Connect input .
2.vim Basic operation
1. Get into vim, Enter... At the system prompt vim And file name , To get into vim Full screen editing screen
for example :vim test.c
Be careful : When it comes to vim After the , The default mode is command mode , If you need to write data , Need to switch to insert mode
2. Command mode toggles insert mode
- [a]
When using a To switch the insertion mode , The cursor will move back one position
- [i]
When using i To switch the insertion mode , The cursor doesn't move
- [o]
When using o To switch the insertion mode , The cursor will be on the next line of the current line
3. Switch command mode to bottom line mode
Input [shift + ;], In essence, it is input :
4. sign out vim And save files
- q : Exit file
- wq: Exit file after saving
- w: Save the file
- q! : Forced exit
3. vim Command mode command set
1. Insertion mode
[i] 、[a] 、[o] Three different switching modes
2. From insert mode 、 Switch from bottom line mode to command mode
Brainless use [esc]
3. Move the cursor
- [h]、[j] 、[k]、[l] Represent the towards the left 、 Down 、 Up 、 towards the right
- [shift+g] It's also G: Jump to the last line of the article
- [gg]: Jump to the first line of the article
- [shift+6] It's also ^: Represents jump to the beginning of the current line
- [shift+4] It's also $: It means to jump to the end of the current line
4. Delete text
- [x]: Press once to delete the character at the current cursor
- [nx]: for example 6x It means to delete 6 Characters
- [shift+x] It's also X: Press once to delete a character in front of the current cursor
- [nX]: for example 6X It means to delete the 6 Characters
- [dd]: Cut the current line
- [ndd]: Cut from the current line n That's ok
5. Copy
- [yy]: Copy the current row
- [p] : Paste the copied
- [nyy]: Copy... From the current line n That's ok
- [np]: Paste n Times copied
6. Replace
- [r]: Replace the character in the current position
- [R]: Replace all characters where the cursor is , Until you press [esc] Key to exit
7. Undo last operation
- [u]: Go back to the last operation
- [ctrl+r]: Reinstatement revocation
8. Transfer to the designated line
- [n+shift+g]: Transfer to No n That's ok
边栏推荐
猜你喜欢

Jmeter 界面如何汉化?

Another skill is to earn 30000 yuan a month+

Detailed explanation of mvcc and its principle

Unit test Chapter6

Could not autowire.No beans of ‘userMapper‘ type found.
![[search] flood fill and shortest path model](/img/22/5240c9ff6ea3c7c1017e3e9a4a27cb.png)
[search] flood fill and shortest path model

34. 分析flexible.js

Mysql表的约束

35.滚动 scroll

How to import PS style? Photoshop style import tutorial
随机推荐
【牛客讨论区】第七章:构建安全高效的企业服务
Be diligent in talking about what sidelines you can do now
Solution: read the files with different names in the two folders and deal with the files with different mappings
Why is count (*) slow
Explanation of index failure principle and its common situations
对话框数据传递
Network protocol details: IP
1、 MySQL Foundation
[untitled] I is circularly accumulated under certain conditions. The condition is usually the length of the loop array. When it exceeds the length, the loop will stop. Because the object cannot judge
精选用户故事|洞态在聚水潭的误报率几乎为0,如何做到?
2022 T2i text generated image Chinese Journal Paper quick view-1 (ecagan: text generated image method based on channel attention mechanism +cae-gan: text generated image technology based on transforme
Replication of df-gan experiment -- detailed steps of replication of dfgan and forwarding from remote port to local port using mobaxtem
Dialog data transfer
Test basis 5
Sunyanfang, co-founder of WeiMiao: take compliance as the first essence and become the "regular army" of financial and business education
[search] flood fill and shortest path model
How to import PS style? Photoshop style import tutorial
Typescript details
一、MySQL基础
项目对接支付宝支付,内网穿透实现监听支付宝的支付成功异步回调通知