$ rg --passthru search -r replace file.txt | sponge file.txt
And preview changes like this: $ rg --passthru search -r replace file.txt | diff -u file.txt -
Of course, this is only practical when working with a single file. Though I'd imagine if one threw in the `--files-with-matches -0` flags together and piped that into `xargs`, something similar to `rep` could be be achieved. (Not that I'd encourage anyone to do this at all) wget -q -O - http://kathack.com/js/kh.js http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js | xclip -sel c
Since there's no spec for global history and it's unlikely one will be introduced, the most practical solution to avoid flooding the browser history would be to debounce the changes.
This is the approach taken by Google Maps -- with maps being a well-known case where URL updates would clutter the history, as noted in the Bugzilla report.
[0] https://bugzilla.mozilla.org/show_bug.cgi?id=753264