命令按键规定

标记 含义
x 按一次 x
dw 按一次 d, w
dap 按一次 d, a, p
同时按 和 n
g<C-]> 按 g, 然后同时按 和 ]
<C-=> 同时按 和 w, 然后同时按 和 =

占位符

标记 含义
f{char} 按f,后面跟任意字符
`{a-z} 按`, 后面跟任意小写字母
m{a-zA-z} 按m,后面跟任意小写或大写字母
d{motion} 按d,后面跟任意动作命令
{register} 同时按 和 r,后面跟一个寄存器地址

显示特殊按键

标记 含义
按退出键
按回车键,也写
按控制键
按制表键
按切换键
同时按
按上光标
按下光标
按空格

在命令行中操作

提示符 含义
$ 在外部shell中执行命令行命令
在命令行模式执行一条Ex命令
/ 用命令行模式执行正向查找
? 用命令行模式执行反向查找
= 用命令行模式对一个Vim脚本表达式求值

替换字符

按键操作 缓冲区内容
{start} ...content is is content is is content...
* ...content is is content is is content...
cwcopy ...content is is content is is content...
n ...content is is content is is copy...
. ...copy is is content is is copy...
可复制的操作及如何回退
目的 操作 重复 回退
做出一个修改 {edit} . u
在行内查找下一指定字符 f{char} / t{char} ; ,
在行内查找上一指定字符 F{char} /t{char} ; ,
在文档中查找下一处匹配处 /pattern<CR> n N
在文档中查找上一处匹配处 ?pattern<CR> n N
执行替换 ????/target/replacement & u
执行一系列修改 qx{changes}q @x u

反向删除

按键操作 缓冲区内容
{start} The end is nigh
db The end is h
x The end is

正向删除

按键操作 缓冲区内容
{start} The end is nigh
b The end is nigh
dw The end is

删除整个单词

按键操作 缓冲区内容
{start} The end is nigh
daw Ten end is

用字数做简单的算术运算
<C-a><C-x>命令分别对数字执行加和减操作

按键操作 缓冲区内容
{start} .blog, .news { backgroud-img: url(/sprite.png);} <\br> .blog { backgroud-position: 0px 0px }
yyp .blog, .news { backgroud-img: url(/sprite.png);} <\br> .blog { backgroud-position: 0px 0px }
.blog { backgroud-position: 0px 0px }
`cW.news .blog, .news { backgroud-img: url(/sprite.png);} <\br> .blog { backgroud-position: 0px 0px }
.news { backgroud-position: 0px 0px }
`cW.news .blog, .news { backgroud-img: url(/sprite.png);} <\br> .blog { backgroud-position: 0px 0px }
.news { backgroud-position: 0px 0px }
180<C-x> .blog, .news { backgroud-img: url(/sprite.png);} <\br> .blog { backgroud-position: 0px 0px }
.news { backgroud-position: -180px 0px }

只在必要时使用次数

按键操作 缓冲区内容
{start} I have a couple of questions.
c3wsome more I have some more questions.

Vim的操作符命令

命令 用途
c 修改
d 删除
y 复制到寄存器
g~ 反转大小写
gu 转换为小写
gU 转换为大写
> 增加缩进
< 减小缩进
= 自动缩减
! 使用外部程序过滤(motion)所跨越的行

相关文章:

  • 2021-04-11
  • 2022-03-02
  • 2022-01-29
  • 2021-10-20
  • 2021-06-07
  • 2022-02-21
  • 2021-11-29
  • 2021-05-24
猜你喜欢
  • 2021-05-22
  • 2022-02-24
  • 2021-12-23
  • 2022-12-23
相关资源
相似解决方案