当前位置:网站首页>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
边栏推荐
- easyswoole uses redis to perform geoRadiusByMember Count invalid fix
- uniapp | 官方提供的map组件使用问题
- npm --package.json---require
- Batch replace file fonts, Simplified -> Traditional
- Small program van-cell line wrapping can be left-aligned
- ES6三点运算符、数组方法、字符串扩展方法
- PHP8.2 version release administrator and release plan
- IP门禁:手把手教你用PHP实现一个IP防火墙
- Function hoisting and variable hoisting
- [phpunit/php-timer]一个用于代码执行时间的计时器
猜你喜欢
随机推荐
Add a full image watermark to an image in PHP
你的本地创建的项目库还在手动创建远端代码仓库再推送吗,该用它了
After the mailbox of the Pagoda Post Office is successfully set up, it can be sent but not received.
[phpunit/php-timer]一个用于代码执行时间的计时器
[symfony/mailer]一个优雅易用的发送邮件类库
IP access control: teach you how to implement an IP firewall with PHP
[vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
[symfony/mailer] An elegant and easy-to-use mail library
逍遥多开模拟器ADB驱动连接
What will be new in PHP8.2?
数组的高级操作
When PHP initiates Alipay payment, the order information is garbled and solved
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
每日面试题 2022/7/28
1.6一些今日学习
ES6介绍+定义变量+不同情况下箭头函数的this指向
PHP图片压缩到指定的大小
Phpstudy installs Thinkphp6 (problem + solution)
MySql Advanced -- Constraints
3. PHP data types, constants, strings and operators