sed -i 's/foo/bar/g' **.rb
It's not precise, so it might take some manual work and tweaking with the patterns, but for how often I've had to rename identifiers, it works good enough to handle the bulk work.A bit of forethought when first naming things works wonders, too.
You need an editor that can understand "this usage of 'containers' refers only to class 'Zoo', so I should find all variables of type 'Zoo' which reference the 'containers' field and change those."
hence
> It's not precise, so it might take some manual work and tweaking with the patterns
and like I said,
> for how often I've had to rename identifiers, it works good enough to handle the bulk work.
so
> You need an editor that can understand
No I don't, because renaming across many files is rare enough that I don't need it.
Most of the time, I do refactoring before it's gotten out of hand and so regular vim features like I mentioned in another comment are typically enough.
In other words, I think such understanding by the editor is too much complexity (and language-constrained, at that) for little reward.