Wednesday, September 19, 2012

Re: FileTypePre autocmd

On Thu, September 20, 2012 06:14, Fermat 618 wrote:
> Thanks, but actually what I want to do is not about a specific filetype,
> but all types.
>
> I used BufEnter and BufLeave event autocmd to handle filetype specific
> menus
> add and remove, but that failed when I set a buffer to another filetype.
> The
> autotocmd should be executed in a context that the filetype is the old
> one.
>
> I read the $VIMRUNTIME/ftplugin.vim where the b:undo_ftplugin take
> effects, but
> that is also trigger by the FileType event, where the old context is left.
> Therefore event if I add my clean up code to b:undo_ftplugin, (which is
> not
> that esay), it will not work.

I don't understand. Why can't you simply use something like this:
:let b:undo_ftplugin .= '| amenu disable MyMenu'

Why do you need the old filetype?

regards,
Christian

--
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