当前位置:网站首页>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 numbers
Common 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
边栏推荐
猜你喜欢
随机推荐
PHP 给图片添加全图水印
display,visibility,opacity
AES加密的各种蛋疼方式方式
正则笔记(1)- 正则表达式字符匹配攻略
简单黑马头条项目
[league/flysystem] An elegant and highly supported file operation interface
js预编译 GO 和AO
Phpstudy安装Thinkphp6(问题+解决)
The querystring module
vue3 访问数据库中的数据
(8) requests、os、sys、re、_thread
13. JS output content and syntax
2.PHP变量、输出、EOF、条件语句
每日五道面试题总结 22/7/23
正则笔记(2)- 正则表达式位置匹配攻略
v-on基本使用、参数传递、修饰词
5.20今日学习
[trendsoft/capital]金额转中文大写库
js scope and closure
MySql高级 -- 约束