当前位置:网站首页>Vim 常用快捷键
Vim 常用快捷键
2022-06-24 12:51:00 【51CTO】
作为 Linux 运维人员,最常用的文本编辑器一定是 Vim ,收集一些 Vim 的常用快捷键以备忘。
特别注意,Vim 区分大小写。
移动光标
方向键移动
h 或 ← 光标左移
l 或 → 光标右移
j 或 ↓ 光标下移
k 或 ↑ 光标上移
单词移动
w (“word”) 光标向右移动一个单词
b (“back”) 光标向左移动一个单词
e (“end”) 移动光标到当前单词的最后一个字母
行首行末移动
类似正则表达式
^ 移动光标到行首
$ 移动光标到行末
屏幕位置移动
H (“high”) 移动光标到屏幕上端
M (“middle”) 移动光标到屏幕中端
L (“low”) 移动光标到屏幕下端
页面滚动
Ctrl-f (“forward”) 向下翻页(整个屏幕)
Ctrl-d (“down”) 向下翻半页(半个屏幕)
Ctrl-b (“backward”) 向上翻页(整个屏幕)
Ctrl-u (“up”) 向上翻半页(半个屏幕)
插入文本
a 在光标右侧插入文本
A 在行末插入文本
i 在光标左侧插入文本
I 在行首插入文本
o 在光标下插入新行
O 在光标上插入新行
修改文本
cw 删除当前单词的光标右侧部分,进入编辑模式
cc 将当前行替换为空行,进入编辑模式
s 删除当前字母,进入编辑模式
r 替换当前字母,输入一个字母后自动返回命令模式
yy 复制当前行
'n'yy 复制当前 n 行,比如 3yy ,复制当前 3 行
p 粘贴已经复制好的文本到下一行
撤销修改
u 撤销上次修改
U 撤销对当前行的所有修改
Ctrl-r 恢复上次修改
删除文本
删除字母
x 删除光标右侧字母
X 删除光标左侧字母
删除单词
dw (“delete word”) 删除当前单词的光标右侧部分 (cw 会进入编辑模式)
daw (“delete a word”) 删除光标所在的整个单词 (包括该单词后面的空格)
diw (“delete inside word”) 删除光标所在的整个单词 (不包括该单词后面的空格)
删除行
dd 删除一行
'n'dd 删除 n 行,比如 2dd 删除连续的两行
dt<char> 删除当前行光标到指定字母 <char>
边栏推荐
- Yolov6: the fast and accurate target detection framework is open source
- "I, an idiot, have recruited a bunch of programmers who can only" Google "
- Several common DoS attacks
- I have fundamentally solved the problem of wechat occupying mobile memory
- The data value reported by DTU cannot be filled into Tencent cloud database through Tencent cloud rule engine
- Quickly understand the commonly used message summarization algorithms, and no longer have to worry about the thorough inquiry of the interviewer
- Comparator sort functional interface
- Coinbase will launch the first encryption derivative for individual investors
- The agile way? Is agile development really out of date?
- Developer survey: rust/postgresql is the most popular, and PHP salary is low
猜你喜欢

LVGL库入门教程 - 颜色和图像

系统测试主要步骤

Hands on data analysis unit 3 model building and evaluation

Comparator 排序函数式接口

"Interesting" is the competitiveness of the new era

谁是鱼谁是饵?红队视角下蜜罐识别方式汇总

爱可可AI前沿推介(6.24)

nifi从入门到实战(保姆级教程)——环境篇

Brief introduction to cluster analysis

Yolov6: the fast and accurate target detection framework is open source
随机推荐
我真傻,招了一堆只会“谷歌”的程序员!
Resolve symbol conflicts for dynamic libraries
Coinbase will launch the first encryption derivative for individual investors
Memory introduction
Integrated API interface code of domestic express companies for intra city distribution and ordering - Express 100
39 - read XML node and attribute values
#yyds干货盘点# 解决剑指offer:调整数组顺序使奇数位于偶数前面(二)
开发者调查:Rust/PostgreSQL 最受喜爱,PHP 薪水偏低
CPU status information us, sy and other meanings
不用Home Assistant,智汀也开源接入HomeKit、绿米设备?
物联网?快来看 Arduino 上云啦
实现领域驱动设计 - 使用ABP框架 - 创建实体
kotlin 数组、集合和 Map 的使用
How to create a new empty branch in the web development process of easyrtc?
Comparator sort functional interface
Prometheus PushGateway 碎碎念
Kubernetes集群部署
hands-on-data-analysis 第三单元 模型搭建和评估
Google Earth Engine——1999-2019年墨累全球潮汐湿地变化 v1 数据集
ERR AUTH&lt; password&gt; called without anypassword configured for the default user. Ar