【发布时间】:2009-03-15 01:05:10
【问题描述】:
如何计算 Vim 中的匹配数?
例如,对于文本
<?
【问题讨论】:
如何计算 Vim 中的匹配数?
例如,对于文本
<?
【问题讨论】:
:%s/<?//ng
见:h count-items。
【讨论】:
【讨论】:
:help count-items
在 VIM 6.3 中,您可以这样做:
:set report=0
:%s/<?/&/g # returns the count without substitution
在 VIM 7.2 中,您可以这样做:
:%s/<?/&/gn # returns the count without substitution
【讨论】: