When I use vr/query-replace I would like the current replace candidate to always be centered on my screen. With the plain old query-replace I can get the desired behavior with following code:
(add-hook 'replace-update-post-hook #'recenter)
I could not find and similar hook for the visual-regexp package. I looked at the source code of the plain query-replace function and found that the replace-update-post-hook is called after perform-replace.
I then saw that vr/query-replace uses a similar function called vr--perform-query-replace, so I thought I could get the desired behavior with the following advice:
When I use
vr/query-replace
I would like the current replace candidate to always be centered on my screen. With the plain oldquery-replace
I can get the desired behavior with following code:I could not find and similar hook for the visual-regexp package. I looked at the source code of the plain
query-replace
function and found that thereplace-update-post-hook
is called afterperform-replace
.I then saw that
vr/query-replace
uses a similar function calledvr--perform-query-replace
, so I thought I could get the desired behavior with the following advice:Unfortunately this advise has no effect.
How can I get similar behavior to
replace-update-post-hook
?