当前位置:网站首页>vim常用命令
vim常用命令
2022-08-09 13:05:00 【zhouyongku】
以下n代表输入的数字
1.跳转到指定行
:n
例如跳转到15行
:15
2.删除某一行
:n d
3.删除光标行
dd
4.删除多行
:n1,n2 d
例如删除2到15行
:2,15 d
5.拷贝光标行
y
6.移动多行
:n1,n2 move n3
例如,将5到8行移动插入到12行
:5,8 move 12
7.注释多行
ctrl+v进入视图模式,按住k或者j进行选择,选择完成后输入shift+i,进入插入模式,输入注释内容,例如#或者//,输入完毕后按住esc,最后ctrl+v进入命令行模式,即可将所有选中行插入#或者//
8.保存
:w
9.退出
:q
10.强制退出
:q!
11.强制保存
:w!
12.到文件头
gg
13.到文件尾
shift+g
14.到行首
0
15.到行尾
$
16.替换和全替换
把第一个a替换程b
/s/a/b
把所有的a替换成b
%s/a/b
17.取消操作
:u取消上一次操作
:U取消所有操作
18.上一行/下一行
上一行:k
下一行:j
19.左右移动
左:h
右:l
20.十六进制查看文件
vim -b 文件名
:%!xxd -g 1
查找例如:ff d0
/ff d0
边栏推荐
- 微服务+微信小程序实现社区服务
- FFmpeg multimedia file processing (implementation of ffmpeg operation directory and list)
- offset、client、scroll、window.pageYOffset比较
- Q_04_04 Q#类型模型
- 5G China unicom AP:B SMS ASCII Transcoding Requirements
- 正则表达式-re模块
- Process/Thread Related in Sandbox - 2
- 面试攻略系列(二)-- 秒杀系统
- render解析
- 陈强教授《机器学习及R应用》课程 第十三章作业
猜你喜欢
面试攻略系列(二)-- 秒杀系统
IDEA Gradle 常遇问题(二)(持续更新)
Anta and Huawei Sports Health jointly verify the champion running shoes and lead Chinese sports with innovation
Map mixed density function and quantile added line
Clock frequency and baud rate count for serial communication in FPGA
七夕力扣刷不停,343. 整数拆分(剑指 Offer 14- I. 剪绳子、剑指 Offer 14- II. 剪绳子 II)
5G China unicom AP:B SMS ASCII Transcoding Requirements
FFmpeg multimedia file processing (the basic concept of ffmpeg processing stream data)
联通网管协议框图
Unity3d_API_Gyroscope 陀螺仪的接口
随机推荐
Anta and Huawei Sports Health jointly verify the champion running shoes and lead Chinese sports with innovation
Q_06_05 文件结构
gin's middleware and routing grouping
剑指offer,剪绳子2
ftplib+ tqdm upload and download progress bar
FFmpeg多媒体文件处理(ffmpeg操作目录及list的实现)
JZ7 重建二叉树
NC96 判断一个链表是否为回文结构
Q_06_02 类型模型
JS本地存储 sessionStorage和localStorage
5G China unicom general exception handling
Final assignment of R language data analysis in a university
Jenkins API groovy calling practice: Jenkins Core Api & Job DSL to create a project
Professor Chen Qiang the machine learning and R application course chapter 18 assignments
现在40系显卡都快出来了,为何1060型号的显卡还有这么多人用?
Explanation of RTSP protocol
5G China unicom AP:B SMS ASCII 转码要求
handwritten big pile
glibc memory management model freeing C library memory cache
记录本项目中用到的系统调用与C库函数-2