当前位置:网站首页>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
边栏推荐
- 柔性数组以及常见问题
- QT 菜单栏、工具栏和状态栏
- Counting Nodes in a Binary Search Tree
- 项目对接支付宝支付,内网穿透实现监听支付宝的支付成功异步回调通知
- C语言 通讯录管理系统(链表,手机号码分段存储,txt文件存取,完整源码)
- Affine transformation module and conditional batch Standardization (CBN) of detailed text generated images
- 支付流程如何测试?
- "Photoshop2021 tutorial" adjust the picture to different aspect ratio
- Knowledge about hash index and b+ tree
- 来自“飞人”乔丹的启示!奥尼尔开启的另一个“赛场”
猜你喜欢

How to test the payment process?

Svn usage details

pyside2____1.安装和案列

【搜索】双向广搜 + A*

Mysql表的约束

What if Photoshop prompts that the temporary storage disk is full? How to solve the problem that PS temporary storage disk is full?

报错:cannot read poperties of undefined(reading ‘then‘)

Knowledge about hash index and b+ tree

树莓派输出PWM波驱动舵机

安装Pygame
随机推荐
接口和抽象类/方法学习 demo
feign调用丢失请求头问题解决及原理分析
Sunset red warm tone tinting filter LUTS preset sunset LUTS 1
对话框简介
[search] flood fill and shortest path model
集成开发环境Pycharm的安装及模板设置
Dialog introduction
Inspiration from "flying man" Jordan! Another "arena" opened by O'Neill
深入 Qt5 信号槽新语法
Why is count (*) slow
Advantages of smart exhibition hall design and applicable industry analysis
二叉搜索树详讲
Invert a Binary Tree
[error reporting] cannot read property 'parsecomponent' of undefined
How does PS import LUT presets? Photoshop import LUT color preset tutorial
Flexible array and common problems
Knapsack problem DP
动态内存函数的介绍(malloc free calloc realloc)
UUID and indexing rules
TypeScript 详解