:bufdo
If you use vim, then you may have discovered that its documentation, while extensive, is nearly impenetrable. One operation I often have to do is
$ for x in [list of files]; do > sed -e '[some substitution]' < $x > $x.bak > mv $x.bak $x > donesince most Unix-based editors don't offer multi-file replace. It turns out that, sometime between 5.3 and 6.x, vim has added the
:bufdo command, so this operation is much simpler as
:bufdo. (See "impenetrable documentation", above.)