call map(keys(g:), 'remove(g:, v:val)')
call map(filter(range(1, bufnr('$')), 'bufexists(v:val)'),
\'map(keys(getbufvar(v:val, "")), '.
\ '"remove(getbufvar(".v:val.", \"\"), v:val)")')
let curtabnr=tabpagenr()
for tabnr in range(1, tabpagenr('$'))
for winnr in range(1, tabpagewinnr(tabnr, '$'))
let windict=gettabwinvar(tabnr, winnr, '')
call map(keys(windict), 'remove(windict, v:val)')
endfor
execute 'tabn' tabnr
call map(keys(t:), 'remove(t:, v:val)')
endfor
execute 'tabn' curtabnr
unlet tabnr curtabnr winnr
It will clear all variables: global, buffer, window, tabpage for all buffers,
windows and tab pages.
That's a nice piece of Vimscript. Probably overkill for this situation,
at least if only run at startup before there are likely to be any local
variables, but it's still pretty cool.
Now if we just had a way to do script vars....
It does not uses redirections which I do not like.
I don't like them either. But since they were needed for other parts of
the solution, I just used them again for consistency.
for s:group in split(s:augroups)
exec "autocmd! ".s:group
unlet s:group
endfor
You forgot to delete the augroup itself:
for s:group in split(s:augroups)
exec "autocmd! ".s:group
execute 'augroup!' s:group
unlet s:group
endfor
True!
Ben.
--
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