在 vim 标准模式下使用 g 键

在 vim 的正常模式下,g前缀用于许多命令。有些命令 去吧位于文档中的某个位置,但是其他命令处理文件编码和交换大小写字母。

  • 表演字符编码
  • 转到10号线
  • gg-转到1号线
  • 选择线路模式
  • gr{char} - virtual replace N chars with {char}

所有这些命令之间缺少的连接是什么?

25597 次浏览

简单来说,你说的是两件不同的事情。在某些情况下,g 是“ global”的缩写(例如,用于 range 命令) ,因为换行时 g 代表 goto。

在 VIM 中,为了快速使用,命令通常被缩短。

:help global可能有帮助

顺便说一下: 对于行导航,我一直使用 :<lineno>语法。

There's no greater connection to g-commands: it's a mixed bunch. It is an easy prefix and the unbound keys were getting extinct so the less-used maps found a good place behind g.