Re: [Vim-latex-devel] Delete Menus when done with editing tex file
Brought to you by:
srinathava,
tmaas
From: Luc H. <her...@fr...> - 2003-09-23 12:34:28
|
hello, * On Sun, Sep 21, 2003 at 11:47:43AM -0700, Srinath Avadhanula <sr...@fa...> wrote: > > au BufLeave FileType=tex call delteMenu() <CR> > > > This topic has come up in the past, and unfortunately, I have been > putting a damper on things. We thought of something like > > au BufEnter * :call Tex_CheckMenus() > > Tex_CheckMenus() will check if the buffer being entered is a tex > buffer and if so, leave the menus intact if they are already present > and regerate the menus if they no longer exist. Otherwise it will > kill the menus. However, regenerating menus is a very time-consuming > process and I beleive it will be more of an annoyance than a > time-saver. In an ftplugin, I'm disabling the menus associated. It is not as slow as deleting every thing, and it can be done on the root menu. Re-enabling the menu is very simple as well. => if g:want_buffermenu_for_tex == 2 " {{{ augroup LTXMenuEnableDisable au! au BufEnter *.tex,*.sty amenu enable LaTeX au BufLeave,BufUnload *.tex,*.sty amenu disable LaTeX augroup END endif " }}} It won't disapear from the menu-bar, but at least it can't be used. -- Luc Hermitte http://hermitte.free.fr/vim/ |