如何通过单键退出Vi编辑器? [英] How do you quit the Vi editor with single keypress?

查看:63
本文介绍了如何通过单键退出Vi编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说实话

:wq!

实在无法输入.

请注意,问题是关于原始Vi(例如FreeBSD随附的Vi)而不是Vim.

Please note that the question is about original Vi (say Vi which comes with FreeBSD) not Vim.

推荐答案

这似乎适用于solaris的旧版vi:

This seems to work on solaris' old version of vi:

Version SVR4.0, Solaris 2.5.0

$ vi -c "map g ZZ" test

编辑:另外,这似乎可行:

edit: Also, this seems to work:

$ vi -c 'map g :q!^M' test

实际上^ M是^ V(ctl-v),然后是^ M(ctl-m)

Where ^M is actually, ^V (ctl-v) then ^M (ctl-m)

这篇关于如何通过单键退出Vi编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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