Changed 'Q' to intelligently close window or kill buffer if it's the last one
This commit is contained in:
12
vim/plugin/settings/window-killer.vim
Normal file
12
vim/plugin/settings/window-killer.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Use Q to intelligently close a window
|
||||
" (if there are multiple windows into the same buffer)
|
||||
" or kill the buffer entirely if it's the last window looking into that buffer
|
||||
function! CloseWindowOrKillBuffer()
|
||||
if(bufwinnr('%')) > 1
|
||||
wincmd c
|
||||
else
|
||||
bdelete
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nnoremap <silent> Q :call CloseWindowOrKillBuffer()<CR>
|
||||
Reference in New Issue
Block a user