Created
October 13, 2017 12:24
-
-
Save doitian/3109eb0951415af317081bbdaf5363fc to your computer and use it in GitHub Desktop.
Close disturbing windows in #vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:CloseDisturbingWin() | |
if &filetype == "help" || &filetype == "netrw" | |
let l:currentWindow = winnr() | |
if s:currentWindow > l:currentWindow | |
let s:currentWindow = s:currentWindow - 1 | |
endif | |
close | |
endif | |
endfunction | |
command! Close :pclose | :cclose | :lclose | | |
\ let s:currentWindow = winnr() | | |
\ :windo call s:CloseDisturbingWin() | | |
\ exe s:currentWindow . "wincmd w" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
一键关闭各种跳出的窗口