cnoremap <expr><enter> (getcmdtype()=='/' ? "\n:redraw" : "\n")

I am intercepring the <enter> in the /pattern search.

When search is found, it works. E.g., type /.<enter>, and you see :redraw
as a sign that mapping worked.

But when search was not found, this mapping does not work.
Why ? Type /xyzxyz<enter>, and :redraw does not appear. Why ?

Yakov

Reply via email to