Vim:选择直到第一场比赛

前端之家收集整理的这篇文章主要介绍了Vim:选择直到第一场比赛前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Lorem ipsum dolor sit amet,hello consectetur adipiscing elit. Vivamus lorem mauris,dictum in ornare sit amet,vulputate at nibh. Integer volutpat justo vitae enim ultrices ultrices. In quis tortor id diam tincidunt feugiat at ut odio. Donec faucibus sapien vitae ante aliquam malesuada. Nam facilisis,metus in tincidunt posuere,hello massa nisi vulputate nunc,id rutrum mi enim non risus. Phasellus ac nisl non tortor pulvinar accumsan at eget leo. Nunc neque mauris,vehicula eget malesuada a,vestibulum non urna. Proin iaculis sem vel nulla porta tristique. Donec magna diam,eleifend quis vehicula in,aliquam in dolor. In et tellus nec metus volutpat dapibus. Duis hello purus dolor,aliquet in vehicula id,adipiscing id lorem. Vivamus elementum,mauris non vulputate tempus,risus elit tincidunt nunc,et posuere velit ligula sit amet purus. Integer pellentesque ultrices sodales. Donec in arcu eu est ullamcorper tincidunt placerat at sem.

我想从一开始就选择一切,直到第一次出现你好

我试试看

/^.*hello

但它返回整个文本,直到最后一个问候.

那怎么办呢

您可以使用视觉模式,然后搜索hello来扩展它
0v/hello<cr>

应该做

否则做一个“非贪心”的搜索,你可以尝试{ – }

/^.\{-\}hello
原文链接:https://www.f2er.com/bash/383863.html

猜你在找的Bash相关文章