Vim的“(插入)VISUAL"模式? [英] Vim's '(insert) VISUAL' mode?

查看:744
本文介绍了Vim的“(插入)VISUAL"模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从插入模式开始,可以通过 CTRL + O v 进入"(insert) VISUAL"模式.这将进入可视模式,但在vim中显示为"(insert) VISUAL",并且在此模式下按 Esc 会使您返回到插入模式,而不是普通模式.在插入模式下,还可以通过移动箭头键来进入"(insert) VISUAL"模式.

The "(insert) VISUAL" mode can be entered by CTRL+O , v starting from insert mode. This enters visual mode, but is displayed as "(insert) VISUAL" from within vim, and pressing Esc from this mode brings you back to insert mode, not normal mode. The "(insert) VISUAL" mode is also entered by shifted arrowed keys from insert mode.

两个相关问题:

  1. 关于这种特殊模式,似乎没有太多文档.有没有一种简单的方法来搜索有关它的信息? (我知道 CTRL + O 通常会做什么.与可视模式的交互似乎很特殊.第一段是引用内容的最简单方法此模式排在首位,因为我不知道它的可搜索名称.)

  1. There does not seem to be much documentation on this special mode. Is there an easy way to search for information about it? (edit: I'm aware of what CTRL+O normally does. The interaction with visual mode seems to be special. The first paragraph was the easiest way to refer to what this mode is in the first place, as I don't know of a searchable name for it.)

如何可靠地编写vmap映射?也就是说,是否有一种一致的方式可以离开视觉模式并最终进入正常模式?还是始终以插入模式结束?

How do you write vmap mappings reliably? Namely, is there a consistent way to leave visual mode and end up in, say normal mode? Or consistently end up in insert mode?

推荐答案

关于第二个问题:您可以使用<C-\><C-n>从任何其他模式切换到普通模式.没有命令可以通过这种方式可靠地切换到可视模式或插入模式,但是如果只需要在可视化之后始终切换到普通模式就足够了.请注意,大多数视觉模式映射均在i<C-o>v特殊模式下运行而无需修改.

About the second question: you can switch to normal mode from any other using <C-\><C-n>. There are no commands for reliably switching to visual or insert modes this way, but if you need only always switching to normal mode after visual it is sufficient. Note that most of the visual-mode mappings are working in i<C-o>v special mode without modifications.

这篇关于Vim的“(插入)VISUAL"模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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