Vim:命令行选择
不要使用范围来集中操作,而是说:
5,10/booboo <-- to find "booboo" between lines 5 and 10
或者
5,10g/booboo/d <-- to delete "booboo" between lines 5 and 10
我想知道是否可以在命令行中搜索范围。 (我理解视觉选择并在该范围内进行操作。)我能想到的就是搜索短语的第一个实例并标记它:
:g/blahblah/mark a
然后是第二个实例:
:g/bleepbleep/mark b
然后在该区域内执行我想要的操作:
:'a,'bg/booboo/d
我在想有更好的方法。
Instead of using a range to focus an action, say:
5,10/booboo <-- to find "booboo" between lines 5 and 10
or
5,10g/booboo/d <-- to delete "booboo" between lines 5 and 10
I was wondering if I can search for the range within the command-line. (I understand the visual selection and act within that range.) All I can think of is to search for the first instance of a phrase and mark it:
:g/blahblah/mark a
Then the second instance:
:g/bleepbleep/mark b
Then perform what I want within that region:
:'a,'bg/booboo/d
I'm thinking there's a better way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以这样做:
您甚至可以更花哨一点,首先将光标发送到文档顶部:
另请参阅
:help [range]
You can do this:
You can even get a little bit more fancy and send the cursor to the top of the document first:
See also
:help [range]