New answers tagged

1

Taking a straight programmatic approach, we can simply implement this as a for loop: :for x in range(3) | :%s/float/long double/ | endfor


2

I'm not entirely sure what's wrong with the regex, though filbranden has some thoughts in the comments. To solve the issue, though, I would do something a bit different: :global/<div>/normal! dat (delete the tag on the lines with an opening div tag).


0

Set vnoremap :s :s/\%V\%V/<Left><Left><Left><Left>. It adds \%V guards and places cursor in the middle. Use End or Ctrl+E to enter replacement pattern.


3

From :h /^ At beginning of pattern or after "|", "(", "%(" or "\n": matches start-of-line; at other positions, matches literal '^'. Hence, as @ChristianBrabandt noted in comments, you must write your pattern as :'<,'>s/^\%V$//n, or alternatively, :'<,'>s/\%V\_^$//n


Top 50 recent answers are included