Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 VIM 中关闭 python 代码窗口后自动关闭 pylint 窗口?
每次我退出 vim 时,仍然显示 pylint 窗口。
当我退出 python 代码时,我想自动关闭 pylint 警告窗口。
我知道手动执行此操作的方法是:qa!
:qa!
假设 pylint 窗口显示一个暂存缓冲区,您可以通过以下命令自动关闭它:autocmd:
:autocmd
:autocmd WinEnter * if winnr('$') == 1 && ! empty(&buftype) && ! &modified | quit | endif
当你 时:quit,你要么退出 Vim,要么进入另一个打开的窗口。上面检查这是一个包含临时缓冲区的单个窗口,该缓冲区具有未持久的更改,然后也退出该窗口。这应该给你一个大致的想法;您可以调整条件以更好地满足您的需求。
:quit