I would like the preview window disappears automatically when cursor is not in the preview window or preview window loses the focus. Is it possible?
I would like the preview window disappears automatically when cursor is not in the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You may want to have a look on autocommands. A simple example would be:
Which calls
pc(close preview window) every time you leave a window. A more involved example could use a separate function that performs extra checking:Check
:h autocmd.txtto learn more. This file has a complete listing of autocommand events in section 5, so you can choose the one that fits better.