Vim:Camel 和 Pascal 大小写中的单词边界

Vim: Word Boundaries in Camel and Pascal Case

考虑这个简单的问题 Python class:

class HelloFoo( ):
    def __init__( ):
        pass

假设我想将 Bar 上的 HelloFoo 中的 Foo 替换为 ciw。但是 Vim 将 HelloFoo 识别为一个词!我该怎么做?我知道我可以在 F 中设置光标 Foo 然后按 c w,其实这不是我想要的。

Vim 目前没有这些的动作或文本对象(但它已经在愿望清单上很长时间了)。

你可以使用像我这样的插件 camelcasemotion, which provides ,w / ,e and ,b motion variants of w / e / b, and also i,w etc. text objects. The plugin page has links to alternative plugins; one notable one is vim-wordmotion;它还提供动作和文本对象,具有可自定义的映射和额外的分隔符。与大多数其他实现不同,它不使用复杂的正则表达式。