How to replace all instances of "foo" with "bar" and "bar" with "foo" in vim?
Besides using a temporary word to change, you can also use the abolish plugin as follows:
:%SubVert/{foo,bar}/{bar,foo}/g
Look at this: how to write only one template for exchanging two lines in two directions in vim
:s/foo\|bar/\={'foo':'bar','bar':'foo'}[submatch(0)]/g
It should be the smartest way to do this, but this one will work for sure!
You can do this using a temporary word. Just make sure it does not exist in the current document.
/\<asd123\> :%s/\<foo\>/asd123/g :%s/\<asd123\>/bar/g :%s/\<bar\>/foo/g
Source: https://habr.com/ru/post/908404/More articles:UISplitViewController on iPad with storyboard? - iosHow can I use GetVolumeInformation in Inno Setup? - installerHow Backbone.JS handles models with computed attributes - backbone.jsUsing columns with special characters in formulas from R - rBoost symbol not found - boostMagento - difference between quote and order - phphow to write only one template for exchanging two lines in two directions in vim - vimDomain wide local memory loss for I6 and IE7? - javascriptfind the location of {x, y} text in uilabel - objective-cWhy do I need a prep interface in Struts2? - javaAll Articles