(similar to Gustavo, but additionally :)
For any previous search, you can simply:
:%s///gn
The template is not needed because it is already in the search register ( @/ ).
"%" - make s/ in the whole file
"g" - global search (with several hits in one line)
"n" - prevents any replacement s/ - nothing is deleted! nothing should be undone!
(see :help s_flag for more information)
(Thus, it works great with βSearch for visually selected text,β as described in vim-wikia tip171 )
tron5 Aug 28 '13 at 12:02 2013-08-28 12:02
source share