3 ms·
This all works in evil-mode as well, and by default you get the cool live-preview (not sure how to enable that for the vanilla C-M-%) :%s/\([0-9]+\))/\,(1-
by skulk 3y ago
This all works in evil-mode as well, and by default you get the cool live-preview (not sure how to enable that for the vanilla C-M-%)
:%s/\([0-9]+\))/\,(1- \#1))/
will turn
1) one
2) two
3) three
into
0) one
1) two
2) three
- mgdlbp 3y ago:%s/\([0-9]\+\))/\=submatch(1)-1.')' " vim perl -pe 's/([0-9]+)\)/$1-1 .")"/e' ruby -pe 'sub(/([0-9]+)\)/){"#{$1.to_i-1})"}'
- globular-toast 3y agoWhat do you mean by live preview? My non-evil Emacs shows you the matches in the current buffer as you type. I don't think I did anything to enable it, but think it's a fairly recent thing (maybe Emacs 29).