问题描述
:g-2-g/3/"中是否有问题,或者全局中的递归丢失了?我不明白该错误的原因:
Is something wrong in ":g-2-g/3/" or is the recursion in the global just missing? I can not understand a reason for the error:
如何在VIM中进行递归全局搜索?
How can I get a recursive global search in VIM?
[Neil与运营商的初步建议\ | ]
g/1.*2\|2.*1/
缺点是组合会扩展为n个数字.对于三个数字,组合数为3! (= 6)即是
A disadvantage is that the combinations expand with n numbers. For three numbers, the number of combinations is 3! (=6) that is
g/1.*2.*3\|2.*1.*3\|3.*1.*2\|1.*3.*2\|2.*3.*1\|3.*2.*1/
对于n个数字,组合数为n!.
For n numbers, the number of combinations is n!.
[与运营商的解决方案\&]
Brian Carper和Neil Butterworth提出了解决方案.非常感谢他们!
Brian Carper and Neil Butterworth figured out the solution. Great thanks for them!
g/.*1\&.*2\&.*3/
它是针对整行的:
g/.*1\&.*2\&.*3\&.*/
推荐答案
新信息:这就是您想要的-"\&"顺序是和"运算符:
New info: This does what you want - the "\&" sequence is the "and" operator:
g/.*1\&.*2\&.*3/
Brian Carper的解释(请参阅评论,再次感谢):
Brian Carper's (see comments, and thanks again) explanation:
这篇关于如何在VIM中递归使用Global?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!