Like global search and replace but don’t like surprises?

Check out serpl – a handy little command-line app that gives you a visual preview of the changes you are about to make. You can even go in and remove the replacements you don’t want from the source previews. The regex support appears to be basic, however (I couldn’t get a negative lookbehind to work).

https://github.com/yassinebridi/serpl#readme

(Also, it appears they’re looking for maintainers. It’s written in Rust.)

#searchAndReplace #findAndReplace #CLI #app #serpl #dev

@aral for those of you using #Emacs it has a similar feature that can be run with M-x occur. You can also run the M-x multi-occur command to do find/replace across multiple files.

In an occur-mode buffer, you can press e to enter “edit mode” and modify each matching line in place, then press C-c C-c to commit those changes to the file. This allows you to do search/replace using the ordinary C-M-% command.

@ramin_hal9001 @aral I guess you just have to reinvent emacs but in a way that they are not easily interlope-able...

I guess you just have to reinvent emacs but in a way that they are not easily interlope-able

@tusharhero what are you talking about?! You can use Unix pipes to make everything interoperable!!! (Sarcasm)

@aral

@ramin_hal9001 @aral That might be true for some programs. But most programs (TUI) are not at all designed for that.

Vim, for example, is not at all like that. I don't know if you can at least pipe buffer regions into programs or not, probably can. But that is something I do all the time inside Emacs.

(I know you are joking).

@tusharhero @ramin_hal9001 @aral You definitely can pipe regions of a vim buffer to a command. I'd say it's even encouraged among vim users.