当前位置:网站首页>1、编辑利器vim
1、编辑利器vim
2022-07-02 11:21:00 【Little BigUs】
VIM
vim有编辑模式和命令模式,编辑模式下输入什么就是什么,命令模式下通过特定的键可以实现特定的功能。
刚进入vim就是命令模式,在命令模式下按 i(在当前光标处插入)、a(在光标之后插入)、o(在光标当前行的下一行插入)
就可以进入插入模式。在插入模式下按ESC退出插入模式进入命令模式。
命令模式下:
:w保存:q退出:wq保存并退出:q!强制退出,不保存u撤销 ,这个很有用Ctrl + r反撤销,这个也很有用
接下来的东西有点绕,是关于复制粘贴的,也很重要。
小写v进入单个选中模式,也就是一个字符一个字符的选中,大写V进入行 选中模式,也就是一行一行的选中,选中之后可以进行复制,按下y进行复制,复制后 按 p进行粘贴。
也可以直接按 yy 复制当前行,无需选中,按nyy复制包括当前行的n行。
yw复制一个单词,nyw复制n个单词。
剪切:
剪切选中部分 :d
剪切一行:dd
剪切n行:ndd
剪切一个单词、剪切n个单词…
查找某一个单词: 斜杠/ + 要查找的单词 ,会找到文件第一个符合条件的单词并高亮显示,按下回车,光标定位到高亮显示的区域。此时按 小写n会定位到下一个该单词,大写N定位到上一个该单词。
如果想要把文件中所有的某个单词替换成另一个单词,操作如下::%s/被替换的单词/新单词其中%s代表整个文件的意思,表示替换范围。如果只想替换某些行,例如我想替换n,m之间的单词,则应该将%换成n,m注意一定要是小写s。
:800直接定位到800行
ctrl+d向下翻页
ctrl+u向上翻页
大写G直接定位到文件末尾,两个小写的g直接定位到文件开头,当然:1也是一样的效果。
21
13
边栏推荐
- [development environment] StarUML tool (download software | StarUML installation | StarUML creation project)
- 万物生长大会在杭召开,当贝入选2022中国未来独角兽TOP100榜单
- Start to write a small demo - three piece chess
- Qt原代码基本知识
- Use of freemaker
- 线性dp求解 最长子序列 —— 小题三则
- Yolov3 & yolov5 output result description
- Quarkus学习四 - 项目开发到部署
- P1908 逆序对
- Teamtalk source code analysis win client
猜你喜欢

Codeforces Round #803 (Div. 2)(A~D)

Pycharm连接远程服务器
![[development environment] Dell computer system reinstallation (download Dell OS recovery tool | use Dell OS recovery tool to make USB flash disk system | install system)](/img/e0/e9cb42f241a60995d4598ba6a1a2fe.jpg)
[development environment] Dell computer system reinstallation (download Dell OS recovery tool | use Dell OS recovery tool to make USB flash disk system | install system)

Available solution development oral arithmetic training machine / math treasure / children's oral arithmetic treasure / intelligent math treasure LCD LCD driver ic-vk1622 (lqfp64 package), original te

PHP linked list creation and traversal

Tencent cloud tstor unified storage passed the evaluation of the first batch of basic file storage capabilities of the ICT Institute

全屋Wi-Fi:一个谁也解决不好的痛点?

QT new project

每日学习3

MySQL 45 lecture - learning from the actual battle of geek time MySQL 45 Lecture Notes - 04 | easy to understand index (Part 1)
随机推荐
Fabric. JS free drawing ellipse
Pychart connects to the remote server
故事點 vs. 人天
Tip: SQL Server blocked the state 'openrowset/opendatasource' of component 'ad hoc distributed queries'
NLA natural language analysis makes data analysis more intelligent
mongodb的认识
Quarkus学习四 - 项目开发到部署
The global special paper revenue in 2021 was about $27 million, and it is expected to reach $35 million in 2028. From 2022 to 2028, the CAGR was 3.8%
Fabric.js 动态设置字号大小
Chinese science and technology from the Winter Olympics (III): the awakening and evolution of digital people
【虹科技术分享】如何测试 DNS 服务器:DNS 性能和响应时间测试
Launcher startup process
Development and design of animation surrounding mall sales website based on php+mysql
OpenHarmony笔记-----------(四)
Teamtalk source code analysis win client
数据湖(十一):Iceberg表数据组织与查询
Golang 快速生成数据库表的 model 和 queryset
How to set QT manual layout
Analysis of CPU surge in production environment service
The use of TestNG, the testing framework (II): the use of TestNG XML