将 VIM 'ci(' 样式命令配置为 'f(' 首先行,如果失败则重试
我使用命令 c
或 d
(更改、删除),然后使用 a
或 i
(包括/排除包装器字符),后跟 '"(){}[]
之一。
例如,ci(
,当光标位于两个括号之间时,将删除括号并让我在剩下的两个括号之间处于插入模式
但是,如果 。我的光标位于以下示例行中的第 0 列,ci(
将失败,因为光标不在 ()
块中。
Example line with some (stuff in parens)
我想要 ci( 从第 0 列开始尝试(并失败),然后使用
f(
重复自身,跳转到该行的第一个括号。这可能/容易吗?我不知道如何挂钩到代码的 ci(
查找失败 堵塞。
I use the command c
or d
(change, delete), followed by a
or i
(including/excluding wrapper chars), followed by one of '"(){}[]
.
For example, ci(
, when the cursor is between two parens, will delete everything in the parens and leave me in insert mode right between the two remaining parens.
However, if my cursor is in column 0 in the following example line, ci(
will fail because the cursor is not in a ()
block.
Example line with some (stuff in parens)
I want ci(
from column 0 to first try (and fail), and then repeat itself with f(
, jumping to the first paren on the line. Is this possible/easy? I can't figure out how to hook into the failure of the ci(
finding of the code block.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不使用:
恕我直言,这将是一个更简单的工作流程。此外,就在几个小时前,我读了一篇非常
Why don't use:
It would be a more simple workflow IMHO. Moreover, just some hours ago I read a very nice answer about this kind on problem.