Is it possible to use vim to replace the ‘http://google.com/’ and other links to ‘#’?
<a class="link1" href="http://google.com/">My Link</a>
<a class="link1" href="http://yahoo.com/">My Link</a>
<a href="http://stackoverflow.com/">My Link</a>
to
<a class="link1" href="#">My Link</a>
<a class="link1" href="#">My Link</a>
<a href="#">My Link</a>
Thanks
This one should handle the basic
httpcase:But this should be more flexible – the general idea is to find instances of
href=", save that as a group, then match until we hit another". Then we replace it with our group (\1) and the hash sign: