当前位置:网站首页>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
边栏推荐
- NC161 二叉树的中序遍历
- 5G China unicom AP:B SMS ASCII 转码要求
- gin的中间件和路由分组
- 剑指 Offer 57 - II. 和为s的连续正数序列(滑动窗口)
- 为什么文字不贴合边
- NFS pays special attention to the problem of permissions
- [FPGA Tutorial Case 48] Image Case 8 - Realization of Converting RGB Image to HSV Image Based on FPGA, Assisted Verification by MATLAB
- Draw a histogram with plot_hist_numeric()
- Periodic sharing of Alibaba Da Tao system model governance
- R language kaggle game data exploration and visualization
猜你喜欢

面试攻略系列(二)-- 秒杀系统

【瑞吉外卖】day05:增、删、改、查分类以及公共字段自动填充

快来扔鸡蛋。

Map mixed density function and quantile added line

搭建大型分布式服务(二)搭建会员服务

七夕力扣刷不停,343. 整数拆分(剑指 Offer 14- I. 剪绳子、剑指 Offer 14- II. 剪绳子 II)

error Trailing spaces not allowed no-trailing-spaces 9:14 error Unexpected trailing comma

eslint语法规则报错

5G China unicom 直放站 网管协议 实时性要求

剑指offer,剪绳子2
随机推荐
[FPGA Tutorial Case 48] Image Case 8 - Realization of Converting RGB Image to HSV Image Based on FPGA, Assisted Verification by MATLAB
Q_04_06 把它放在一起:传送
面试攻略系列(三)-- 高级开发工程师面试问些啥?
An Offer 21. Adjust the array in order to make odd in even the front (loop invariant)
2.微服务'黑话'集锦及Eureka注册中心相关概念
陈强教授《机器学习及R应用》课程 第十六章作业
FFMPEG multimedia file processing (deletion and renaming of ffmpeg files)
GIN初探,环境安装
uni-app - uview Swiper 轮播图组件点击跳转链接(点击后拿到 item 行数据, 取出数据做操作)
NFS pays special attention to the problem of permissions
NC84 完全二叉树结点数
Professor Chen Qiang's "Machine Learning and R Application" course Chapter 16 Assignment
RTSP协议的实现
glibc memory management model freeing C library memory cache
技嘉显卡 RGBFusion 不能调光解决方法
剑指 Offer 57 - II. 和为s的连续正数序列(滑动窗口)
[MRCTF2020]套娃-1
Q_06_02 类型模型
Professor Chen Qiang the machine learning and R application course chapter 18 assignments
FPGA - Summary of bugs in ISE (in update)