当我输入 .wq 时会发生什么!在vim中? [英] What happens when I enter .wq! in vim?

查看:33
本文介绍了当我输入 .wq 时会发生什么!在vim中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 vim 中输入 .wq! 时会发生什么?有没有办法禁止这种行为?

What happens when I enter .wq! in vim? Is there a way to prohibit that behavior?

推荐答案

使用 vim 的帮助来理解每一个

use vim's help to understand each of those

. - 重复上次更改 - :h .

. - repeat last change - :h .

w - 将光标移动到下一个单词 - :h w

w - move cursor to next word - :h w

q! - q 将开始记录宏,但由于 ! 不是记录宏的有效寄存器,因此它们只是取消彼此

q! - q would start recording a macro but since ! isn't a valid register to record the macro to they simply cancel each other

你可以添加 nmap .wq!<Nop> 到您的 vimrc 以使此组合成为 noop,但我不建议这样做.它会使您的 . 响应变慢,因为它是现有地图的前缀,因此如果您了解更多信息并开始使用此功能,则此地图会惹恼您.

you could add nmap .wq! <Nop> to your vimrc to make this combination a noop but I wouldn't recommend doing that. It would make your . respond slower since it's a prefix for an existing map so if you ever learn more and start using this feature this mapping will annoy you.

这篇关于当我输入 .wq 时会发生什么!在vim中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆