Is it possible to make the highlight of searched terms persist after pressing RET? I had liked very much the behavior of zathura in this aspect.

My question is :

Can pdf-tools be tweaked to have the same behavior of isearch with isearch-lazy-highlight-cleanup set to nil? (i.e. make highlighting persist after stop searching)

  • Please pose only one question per question. (And your second question, at the end, is anyway unclear. What do you mean by "looking for" the current highlight?)
    – Drew
    Jan 12, 2020 at 17:05
  • There is no straight-forward way of doing this.
    – politza
    Jan 12, 2020 at 21:14

1 Answer 1


I know nothing about pdf-tools. But it sounds like you're just asking how to make Isearch's lazy highlighting persist after you stop searching.

If so, the answer to that is to set user option lazy-highlight-cleanup to nil. C-h v tells you:

lazy-highlight-cleanup is a variable defined in isearch.el.

Its value is t


Controls whether to remove extra highlighting after a search.

If this is nil, extra highlighting can be "manually" removed with M-x lazy-highlight-cleanup.

You can customize this variable.

  • 1
    Thank you, that's the behaviour I'm looking for but in pdf-tools. Unfortunately, lazy-highlight-cleanup doesn't have an effect on pdf-tools. I removed the second question because pdf-tools does highlight differently current match and other matches. The sole issue now, is to make it persist. The answer should reside in pdf-isearch but I'm relatively new with emacs. Jan 12, 2020 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.