- 课程链接:https://www.imooc.com/learn/1129
- 课程名称:玩转Vim 从放弃到爱不释手
- 章节名称:
- 第2章:初识 Vim,想说爱你不容易
- 2-5:Vim快速增删改查
- 第2章:初识 Vim,想说爱你不容易
- 讲师姓名:PegasusWang
- 时间:2022-09-22 12:57
课程内容快速增删改查
- 增加字符
- a/i/o;A/I/O
- 快速删除
- x/{n}x
- dw/daw/diw/dd/{n}d…
- dt{char}/d0/d$
- di{char} — delete all content inside char code.
- 可视模式下选中字符,使用x来删除
- 快速修改
- r\color{red}rr(replace)
- Repalce one character
- R\color{red}RR — Keep replacing until ESC clicked.
- c\color{red}cc(change)
- Change and into edit model
- cw/caw/ciw/ct{char}
- cc — Delete all line
- C – Delete right content
- s\color{red}ss(substitute)
- Delete one character and switch into Edit model
- {n}s
- S\color{red}SS — Delete one line and switch into Edit model.
-快速查找
- /\color{red}//:全局查找向后匹配;
- :set hls设置把查找到的内容高亮显示
- :set incsearch增量搜索,即边搜索边高度,输入内容会立即进行匹配
- n移动到下一个;N移动到上一个
- ∗\color{red}*∗:当前光标处的单词,可以通过录入*移动到下一个与之匹配的字符前,而#\color{red}\##是向上匹配
- r\color{red}rr(replace)
学习心得:发现作用一样的快捷键
cc\color{red}cccc和S\color{red}SS作用是一样的