防止插件重新映射 vim 中的键
我为 vim 安装了一堆插件,其中一个破坏了 dw 命令。我不确定它是哪一个。基本上, dw 现在正在删除它找到的下一个空格之前的所有内容,而不是像它应该的那样在标点符号处停止。
我真的不想弄清楚是哪一个破坏了它以及如何修复它。有没有办法可以在 .vimrc 中指定我不想更改它?
编辑:
Luc 已经回答了我的问题,但我想我仍然会为未来的读者澄清它,因为对于 dw
应该做什么存在一些分歧默认。假设我们有单词 1234.5678。默认情况下,在我使用过的所有系统上,如果光标位于 1 上,则输入 dw
应该会得到 0.5678。当我问这个问题时,为我输入 dw 反而删除了整个内容(1234.5678)。
I have a bunch of plugins installed for vim, and one of them is breaking the dw
command. I'm not sure which one it is though. Basically dw
is now deleting everything up through the next bit of whitespace it finds, instead of stopping at punctuation like it should.
I really don't want to have to figure out which one is breaking it and how to fix it. Is there a way I can specify in my .vimrc that I don't want it changed?
Edit:
Luc already answered my question, but I thought I would still clear it up for future readers, because there is a bit of disagreement over what dw
is supposed to do by default. Lets say we have the word 1234.5678. By default, on all the systems I've worked on, if the cursor is on the 1, typing dw
should leave you with .5678. When I asked the question, typing dw for me was instead deleting the whole thing (1234.5678).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
dw 不是映射。 d 是一个接受 motion 和正确行为的命令正是你所描述的那种。 dw 代表删除单词并执行此操作:)。顺便说一句,如果您想了解有关映射的信息,我建议您尝试以下命令:
这将为您提供所有映射的列表。奇妙的是:
它为您提供了有关给定映射的详细信息(在我们的示例中
)dw isn't a mapping. d is a command that accepts a motion and the correct behaviour is exactly the one described by you. dw stands for delete word and does that :). By the way, if you want to know something about you mappings I suggest you to try the following commands:
that gives you the list of all your mappings. And the wonderful:
that gives you details about the given mapping ( in our case
<c-s>
)如果问题不在 @Luc Hermitte 提到的“iskeyword”选项中,则有两种可能性:
重新映射
d
或dw
的正常模式映射。检查是否是问题的命令:。它将报告所有
d*
映射,包括d
本身和dw
。我认为不会有很多。重映射
w
的运算符挂起映射。检查使用我不认为任何插件作者足够傲慢地重新映射这个,所以首先检查@Luc Hermitte的答案。
If the problem is not in 'iskeyword' option mentioned by @Luc Hermitte, then there are two possibilites:
Normal-mode mapping that remaps
d
ordw
. Command to check whether it is the problem:. It will report all
d*
mappings, includingd
itself anddw
. I do not think there will be many.Operator-pending mapping that remaps
w
. Check usingI don't think though that any plugin author is arrogant enough to remap this, so first check @Luc Hermitte's answer.
我不认为你在寻找正确的东西。而是搜索哪个(ft?)插件覆盖
'isk'
- 仍然很详细 ->:详细设置isk
I don't think you are looking for the right thing. Search instead which (ft?) plugin is overriding
'isk'
-- still with verbose ->:verbose set isk