当前位置:网站首页>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>
边栏推荐
- Opengauss kernel: simple query execution
- Internet of things? Come and see Arduino on the cloud
- Quickly understand the commonly used message summarization algorithms, and no longer have to worry about the thorough inquiry of the interviewer
- "I, an idiot, have recruited a bunch of programmers who can only" Google "
- How long will it take to open a mobile account? Is online account opening safe?
- How does webrtc obtain video stream data on the C ++ side?
- Sphere, openai and ai21 jointly publish the best practice guidelines for deployment models
- 初中级开发如何有效减少自身的工作量?
- Perhaps the greatest romance of programmers is to commemorate their dead mother with a software
- 3. Caller 服务调用 - dapr
猜你喜欢
Beauty of script │ VBS introduction interactive practice
How stupid of me to hire a bunch of programmers who can only "Google"!
数据科学家面临的七大挑战及解决方法
10 个 Reduce 常用“奇技淫巧”
爱可可AI前沿推介(6.24)
Brief introduction to cluster analysis
物联网?快来看 Arduino 上云啦
Quickly understand the commonly used message summarization algorithms, and no longer have to worry about the thorough inquiry of the interviewer
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
Comparator 排序函数式接口
随机推荐
kotlin 继承、类、重载
敏捷之道 | 敏捷开发真的过时了么?
华为AppLinking中统一链接的创建和使用
LVGL库入门教程 - 颜色和图像
YOLOv6:又快又准的目标检测框架开源啦
系统测试主要步骤
Configuration (enable_*) parameter related to execution plan in PG
Nifi from introduction to practice (nanny level tutorial) - environment
AGCO AI frontier promotion (6.24)
实现领域驱动设计 - 使用ABP框架 - 创建实体
不用Home Assistant,智汀也开源接入HomeKit、绿米设备?
我从根上解决了微信占用手机内存问题
手把手教你用AirtestIDE无线连接手机!
Parti,谷歌的自回归文生图模型
物联网?快来看 Arduino 上云啦
[log service CLS] Tencent cloud log service CLS accesses CDN
The 35 "top 100 counties" of tmall 618 agricultural products come from the central and western regions and Northeast China
Golden age ticket: Web3.0 Security Manual
Cohere、OpenAI、AI21联合发布部署模型的最佳实践准则
kotlin 数组、集合和 Map 的使用