Vim Treat' - '作为单词的一部分,如果后面是字母,但是'>'
有没有办法告诉VIM处理 this-is-One-word
但 this->
-
并不是其中的一部分word(例如 dw
时)。
编辑以进行澄清:
我已经 - 设置为单词的一部分,因此在的开头
删除所有这些。但是,如果我有代码 dw
this-is-In-One-word $ logger-≫ info
并将我的光标指向logger,则点击 dw
,它包括 - 剩下的 $> info
$ - > info
我想要的。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定我正确理解您的问题,
dw
仅删除字符串
this-is-is-One-word通常,如果我想删除<代码> this-is-One-word ,我将使用
dt&lt; space&gt;
假设有一个&lt; space&gt;
之后not sure I understand your question correctly,
dw
only deletesthis
for stringthis-is-one-word
in general if I want to delete
this-is-one-word
, I would usedt<space>
assuming there is a<space>
after阅读
:HISKEYWORD
。但是我想不可能实现自己想要的东西。无论如何,至少您有一个起点:注意:帮助说它是本地与缓冲区的,这就是为什么
setLocal
与set set
相反的原因。例如,应将其放置在
/after/ftplugin/css.vim
中,例如,这种方式-
将仅在该特定的Filetype中成为单词的一部分。在这篇文章您可以阅读有关
/ftplugin之间差异的信息
和/之后/ftplugin
。Read on
:h iskeyword
. But I guess it is not possible to achieve what you want. Anyway, at least you have a start point:Note: The help says it is local to buffer, that's why
setlocal
in opposition toset
.This should be placed at
/after/ftplugin/css.vim
for example, this way the character-
will be part of the word only in that particular filetype.In this post you can read about differences between
/ftplugin
and/after/ftplugin
.