Just enter the following command in Vim, to replace all XXX match with the number of the line where the match is:
:%s/XXX/\=line(".")
Ex:
this is a example : XXX
and XXX
... is then
this is a example : 1
and 2
Just enter the following command in Vim, to replace all XXX match with the number of the line where the match is:
:%s/XXX/\=line(".")
Ex:
this is a example : XXX
and XXX
this is a example : 1
and 2
0 comments:
Post a Comment