当前位置:网站首页>Basic use of vim - command mode
Basic use of vim - command mode
2022-08-01 01:34:00 【HUAWEI CLOUD】
vim command mode command set
- Press "i" to switch to insert mode "insert mode", and press "i" to enter insert mode to start inputting the file from the current position of the cursor;
- Press "a" to enter insert mode, and start typing text from the position next to the current cursor position;
- After pressing "o" to enter insert mode, a new line is inserted, and the text is entered from the beginning of the line.
- Switch from insert mode to command mode
- Press
esc
- Press
- Move the cursor
- vim can directly use the cursor on the keyboard to move up, down, left and right, but regular vim uses lowercase English letters "h", "j", "k",
"l" to control the cursor left and down respectively, up, right move one space- Remember:
- The h key is on the left side, and the l on the left and right sides means left and right
- j:jump jumps down
- k:king is on top
- Press "G": move to the end of the article
- Press "shift+ $": move to the "end of line" of the line where the cursor is located
- Press "shift+^": move to the "start of line" of the line where the cursor is located
- Move the cursor forward and backward in units of words
- Press "w": the cursor jumps to the beginning of the next word (move left, move forward)
- Press "e": the cursor jumps to the end of the next word
- Press "b": the cursor returns to the beginning of the previous word (move right, move back)
- Press "#l": the cursor moves to the #th position of the line, such as: 5l, 56l
- Press [gg]: go to the beginning of the text (jump to the start line)
- Press [shift+g]: enter the end of the text (jump to the end line)
- n+shift+g : jump to the specified line
- Press "ctrl" + "b": the screen moves to the "back" page
- Press "ctrl" + "f": the screen moves "forward" one page
- Press "ctrl" + "u": the screen moves to the "back" half page
- Press "ctrl" + "d": the screen moves to the "forward" half page
- vim can directly use the cursor on the keyboard to move up, down, left and right, but regular vim uses lowercase English letters "h", "j", "k",
- Delete text
- 「x」: lowercase x, each time you press, delete a character at the cursor position (lowercase x: delete from left to right)
- Support nx to delete the cursor position and n characters after it
- "#x": For example, "6x" means to delete the 6 characters "behind (including itself)" where the cursor is located
- "X": Capital X, each press deletes one character "before" the cursor position (Capital X: delete from right to left)
- Support nX to delete the cursor position and its n characters ahead
- "#X": For example, "20X" means to delete 20 characters "before" the cursor position
- "dd": delete the line where the cursor is located
- Support ndd to delete n lines at a time, including the current line
- “#dd”: delete # lines from the line where the cursor is located
- 「x」: lowercase x, each time you press, delete a character at the cursor position (lowercase x: delete from left to right)
- Copy
“yw”: Copy the characters from the cursor position to the end of the word into the buffer.
“#yw”: copy # words to buffer
"yy": Copy the line under the cursor to the buffer.
"#yy": For example, "6yy" means to copy 6 lines of text "counting down" from the line where the cursor is located.
- nyy means to copy n lines of text from the line where the cursor is located, including the current line
"p": Pastes the characters in the buffer to the cursor position.
np: Repeat n lines at a time
Note: All copy commands related to "y" must be combined with "p" to complete the copy and paste function.
First yy, then directly np: copy n lines after the cursor position
p after dd: cut
- Replace
- “r”: replace the character at the cursor
- Support nr to replace n characters later
- "R": replace the character at the cursor position until the "ESC" key is pressed
- shift + r replace mode, directly replace multiple contents
- “r”: replace the character at the cursor
- Undo the last action
- “u”: Undo the wrong operation,If you execute a command by mistake, you can press “u” immediately to go back to the previous operation.Press 'u' multiple times to perform multiple restores
- "ctrl + r": Undo redo
- Change
- "cw": change the word where the cursor is to the end of the word
- "c#w": For example, "c3w" means change 3 words
- shift + ~ : quick case switch
- Jump to the specified line
- "ctrl"+"g" lists the line number of the line where the cursor is located
- "#G": For example, "15G", which means move the cursor to the beginning of line 15 of the article
边栏推荐
- MYSQL查询截取优化分析
- 链式编程、包、访问权限
- Fat interface in JQESAP system
- Luogu P3373: Segment tree
- Flink deploys and submits jobs
- Flink 部署和提交job
- Google engineer fired for claiming AI awareness: breach of nondisclosure agreement
- Google "Cloud Developer Quick Checklist"; Tsinghua 3D Human Body Dataset; SenseTime "Universal Vision Framework" open class; Web3 Minimalist Getting Started Guide; Free Books for Efficient Deep Learni
- TCP协议详解
- VPGNet
猜你喜欢
![[Data analysis] Based on matlab GUI student achievement management system [including Matlab source code 1981]](/img/65/b84443b98c28d2728e9ae44b1294fb.jpg)
[Data analysis] Based on matlab GUI student achievement management system [including Matlab source code 1981]

RTL8762DK RTC (5)

IDEA无法识别module(module右下角没有蓝色小方块)

蓝图:杨辉三角排列

MYSQL Index Analysis

【数据分析】基于matlab GUI学生成绩管理系统【含Matlab源码 1981期】

ROS2系列知识(4): 理解【服务】的概念

Detailed explanation of TCP protocol

RTL8762DK 点灯/LED(三)

北京突然宣布,元宇宙重大消息
随机推荐
Exam preparation plan
MYSQL two-phase commit
Google "Cloud Developer Quick Checklist"; Tsinghua 3D Human Body Dataset; SenseTime "Universal Vision Framework" open class; Web3 Minimalist Getting Started Guide; Free Books for Efficient Deep Learni
TCP协议详解
数据中台建设(七):数据资产管理
OSD read SAP CRM One Order application log way of optimization
[cellular automata] based on matlab interface aggregation cellular automata simulation [including Matlab source code 2004]
RTL8762DK UART(二)
GDB 源码分析系列文章五:动态库延迟断点实现机制
OSF一分钟了解敏捷开发模式
Item 36: Specify std::launch::async if asynchronicity is essential.
【历史上的今天】7 月 31 日:“缸中之脑”的提出者诞生;Wi-Fi 之父出生;USB 3.1 标准发布
WeChat applet page syntax
Talking about hardware device computing storage and data interaction
C string array reverse
Inheritance Considerations
软考高级系统架构设计师系列之:系统开发基础知识
YOLO怎么入门?怎么实现自己的训练集?
MYSQL索引解析
Four ways the Metaverse is changing the way humans work