Thanks for all your input! Used it to create a function that quits vi when the last buffer is closed (didn't find one that worked out of the box with my settings):
function! QuitIfLast(wipe)
" Delete/wipe-out the current buffer
if a:wipe == 1
bwipeout!
else
bdelete
endif
" Check to see if there are more buffers around
redir => l:ls
silent ls
redir END
let l:files = split(l:ls, "\n")
if len(l:files) == 1 && stridx(l:files[0], "\[No Name\]") != -1
quit
endif
endfunction
Greetings
Axel
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment