防止插件重新映射 vim 中的键

发布于 2024-12-02 06:11:17 字数 379 浏览 0 评论 0原文

我为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

伪装你 2024-12-09 06:11:17

dw 不是映射。 d 是一个接受 motion 和正确行为的命令正是你所描述的那种。 dw 代表删除单词并执行此操作:)。顺便说一句,如果您想了解有关映射的信息,我建议您尝试以下命令:

:map

这将为您提供所有映射的列表。奇妙的是:

:verbose map <c-s>

它为您提供了有关给定映射的详细信息(在我们的示例中

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:

:map

that gives you the list of all your mappings. And the wonderful:

:verbose map <c-s>

that gives you details about the given mapping ( in our case <c-s>)

挽清梦 2024-12-09 06:11:17

如果问题不在 @Luc Hermitte 提到的“iskeyword”选项中,则有两种可能性:

  1. 重新映射 ddw 的正常模式映射。检查是否是问题的命令:

    详细 nmap d
    

    。它将报告所有 d* 映射,包括 d 本身和 dw。我认为不会有很多。

  2. 重映射w的运算符挂起映射。检查使用

    详细 omap w
    

我不认为任何插件作者足够傲慢地重新映射这个,所以首先检查@Luc Hermitte的答案。

If the problem is not in 'iskeyword' option mentioned by @Luc Hermitte, then there are two possibilites:

  1. Normal-mode mapping that remaps d or dw. Command to check whether it is the problem:

    verbose nmap d
    

    . It will report all d* mappings, including d itself and dw. I do not think there will be many.

  2. Operator-pending mapping that remaps w. Check using

    verbose omap w
    

I don't think though that any plugin author is arrogant enough to remap this, so first check @Luc Hermitte's answer.

秋心╮凉 2024-12-09 06:11:17

我不认为你在寻找正确的东西。而是搜索哪个(ft?)插件覆盖 'isk' - 仍然很详细 -> :详细设置isk

:h w 
:h word

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

:h w 
:h word
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文