当前位置:网站首页>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
边栏推荐
- 默认插槽,具名插槽,作用域插槽
- Pycharm连接远程服务器
- 每天坚持20分钟go的基础二
- Tip: SQL Server blocked the state 'openrowset/opendatasource' of component 'ad hoc distributed queries'
- Whole house Wi Fi: a pain point that no one can solve?
- The conference on the growth of all things was held in Hangzhou, and dangbei was selected into the top 100 list of future unicorns in China in 2022
- OpenHarmony笔记-----------(四)
- NLA自然语言分析,让数据分析更智能
- C语言高级用法--函数指针:回调函数;转换表
- Default slot, named slot, scope slot
猜你喜欢

<口算练习机 方案开发原理图>口算练习机/口算宝/儿童数学宝/儿童计算器 LCD液晶显示驱动IC-VK1621B,提供技术支持

自定义事件,全局事件总线,消息订阅与发布,$nextTick

In 2021, the global styrene butadiene styrene (SBS) revenue was about $3722.7 million, and it is expected to reach $5679.6 million in 2028

Daily learning 3

Certik released the defi security report in 2021, disclosing key data of industry development (PDF download link attached)

QT new project

PHP linked list creation and traversal

PyQt5_ Qscrollarea content is saved as a picture

无主灯设计:如何让智能照明更加「智能」?

联合搜索:搜索中的所有需求
随机推荐
Do you know that there is an upper limit on the size of Oracle data files?
Data consistency between redis and database
Understanding of mongodb
P1908 reverse sequence pair
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
千元投影小明Q1 Pro和极米NEW Play谁更好?和哈趣K1比哪款配置更高?
Slashgear shares 2021 life changing technology products, which are somewhat unexpected
删除元素(带过渡动画)
The most complete analysis of Flink frame window function
In 2021, the global styrene butadiene styrene (SBS) revenue was about $3722.7 million, and it is expected to reach $5679.6 million in 2028
Story points vs. human days
Pycharm连接远程服务器
数据湖(十一):Iceberg表数据组织与查询
Convolutional neural network (Introduction)
freemarker的使用
[to be continued] [UE4 notes] l5ue4 model import
Dangbei projection 4K laser projection X3 Pro received unanimous praise: 10000 yuan projector preferred
Qt新建项目
Thymeleaf dependency
Quarkus learning IV - project development to deployment