当前位置:网站首页>vim edit mode
vim edit mode
2022-08-02 03:54:00 【strive to ping】
vim enters edit mode, vim command mode
vim enters edit mode
To enter the editing mode from the normal mode, just press one of the keys i, I, a, A, o, O, r and R. When entering the editing mode, INSERT (if Chinese is supported, insert is displayed).Press the Esc key to return from edit mode to normal mode.
The meaning of the key function
i Insert before the current character (memory: insert)
I Insert at the beginning of the line where the cursor is located
a Insert after the current character (memory: after insert)
A Insert
at the end of the line where the cursor is located o Insert a new line in the current next line
O Insert a new line in the current previous line(memory: switch)
S deletes the line where the cursor is located and starts inserting a similar overwrite replacement operation (memory: switch)
Vim bottom line mode functionIn normal mode, enter or / to enter command modeCommand Function Meaning:w save file (memory: write):q is used to exit Vin without modifying the contents of the file (memory: quit):w! Force save, even if the text is read-only, the save can be done under the root user:q! Force quit, so the changes will not take effect Use when modifying and not saving the contents of the file:wq save and exit (remember :write quit):set nu display line number:set nonu don't show line numbersCommon commands in three modes of vim
/*vim common commands in three modes*Command Meaning Remarksyy Copy the line where the cursor is located 3yy means copy 3 lines, nyy means copy n linesp starts pasting at the lower line of the line where the cursor is located (remember: lowercase at the bottom)P starts pasting on the upper line of the line where the cursor is located (memory: uppercase)gg The cursor jumps to the first character of the first line ngg means jump to the position n lines away from the first lineG cursor jumps to the first letter of the last line^ (shift+6) Jump to the first letter of the line where the cursor is located (memory: ^ means head)#(shift+3) Jump to the letter at the end of the line where the cursor is located (memory: $ means tail)*dd or D delete the line where the cursor is locatedd^ delete from the cursor position to the beginning of the line (excluding the cursor) (memory: d means delete, ^ means head, d^ means delete to the beginning)d$ delete from the cursor position to the end of the line (including the cursor) (memory: d means delete, ^ means the end, d^ means delete to the end)dgg delete all lines above the line where the cursor is located (memory: d means delete, gg means locate the first letter of the first line, that is, dgg means delete to the first line)dG deletes all lines below the line where the cursor is located (memory: d means delete, G means positioning to the first letter of the last line, that is, dG means deleting to the last line)x delete a character after the cursor nx means delete n characters after the cursor, similar to the delete key under windows (try it and find that the delete key under linux has the same function as x)X delete a character before the cursor nX means delete n characters after the cursor, similar to the backspace keyboard under windows (try to find that the backspace under linux means the cursor moves left)u undo the last operationctrl+←/→ keys quickly move the cursor left and right, that is, move quickly between each space and line)n+←/→ keys move n characters to the left or right边栏推荐
猜你喜欢
随机推荐
js basics
js eventLoop 事件循环机制
16. JS events, string and operator
MySql高级 -- 约束
DVWA靶机安装教程
1.uview form校验位置可以改变 2.时间区间
每日五道面试题总结 22/7/23
(5) 模块与包、编码格式、文件操作、目录操作
[symfony/finder]最好用的文件操作库
[phpunit/php-timer]一个用于代码执行时间的计时器
项目中遇到的问题
PHP图片压缩到指定的大小
IP门禁:手把手教你用PHP实现一个IP防火墙
16.JS事件, 字符串和运算符
1.初识PHP
1.8今日学习
Baidu positioning js API
解决uni-app 打包H5网站 下载图片问题
3. PHP data types, constants, strings and operators
v-on基本使用、参数传递、修饰词









