附加到视觉障碍在vim中不起作用 [英] prepend to visual block not working in vim

查看:80
本文介绍了附加到视觉障碍在vim中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢在Windows中使用 Ctrl - V ( Ctrl - Q )来修改视觉块.该技术的解释如下:

I'm really fond of this idea of using Ctrl-V (Ctrl-Q in windows) to modify a visual block. The technique is explained here: In Vim how do I effectively insert the same characters across multiple lines?

由于某种原因,这在VIM 7.2.411中对我不起作用.

For some reason, this is not working for me in VIM 7.2.411.

我按 Ctrl - V 表示视觉障碍,然后按 J 几次以扩大选择范围.然后按 Shift - I 插入并放置文本,当我按 Esc 时,它仅修改了选择内容的第一行.我很难弄清楚为什么这在我的linux机器上不起作用.相同的技术对Windows中的gvim很有用.

I press Ctrl-V, it says visual block, and I press J several times to expand my selection. Then I press Shift-I to insert, place my text, and when I press Esc, it has only modified the top line of the selection. I've had a hard time figuring out why this isn't working on my linux box. The same technique works great for gvim in windows.

是什么阻止了此工作,或者我应该采取其他措施吗?

What might be preventing this from working, or what should I try differently?

推荐答案

问题的根源是缺乏编译支持(这要归功于我的共享托管服务提供商).对于其他有类似问题的人,请检查vim的+ visualextra选项.您可以通过以下方式从正常模式进行检查:

The source of the problem was lack of compiled support (thanks to my shared hosting provider). For others who are having a similar problem, check vim for the +visualextra option. You can check from normal mode with:

:echo has('visualextra')

如果返回,它将返回"1".否则,您可以使用:

It will return a "1" if it does. Otherwise you can look using:

:version

或者通过从命令行调用--version选项:

Or by invoking the --version option from the commandline:

vim --version | grep visualextra

这篇关于附加到视觉障碍在vim中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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