-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
It would be great if there is no need to quit the NERD_tree* buffers to quit Vim.
Maybe this can be put into the NERDTree as an option?
I have created a small function to get this feature. Just put this code into your .vimrc:
function! NERDTreeQuit()
redir => buffersoutput
silent buffers
redir END
" 1BufNo 2Mods. 3File 4LineNo
let pattern = '^\s*\(\d\+\)\(.....\) "\(.*\)"\s\+line \(\d\+\)$'
let windowfound = 0
for bline in split(buffersoutput, "\n")
let m = matchlist(bline, pattern)
if (len(m) > 0)
if (m[2] =~ '..a..')
let windowfound = 1
endif
endif
endfor
if (!windowfound)
quitall
endif
endfunction
autocmd WinEnter * call NERDTreeQuit()
Greetings
Michael
mdtareque, polinom, Notaduck, jonbodart, Sydney-o9 and 6 moremdtareque and Notaduck
Metadata
Metadata
Assignees
Labels
No labels