Wednesday, April 6, 2011

Re: menu.vim overwritten

On 07/04/11 03:09, John Little wrote:
> On Apr 6, 2:59 am, rameo<rai...@gmail.com> wrote:
>> When I install a new vim version, the installer asks if it has to
>> create a new _vimrc file but it doesn't so for menu.vim.
>> Last time my menu.vim was overwritten.
>
> What I do is:
> - In .vimrc (or _vimrc) near the beginning I have
>
> let did_install_default_menus = 4
>
> - I have my menu.vim in vimfiles or .vim (early in the runtimepath
> option).
> - In .gvimrc or _gvimrc I have
>
> if did_install_default_menus == 4
> "default menu.vim was suppressed
> unlet did_install_default_menus
> runtime menu.vim
> endif
>
> What's not good about my approach is that whenever there's a new
> version of menu.vim I merge it with my changes, a tedious task, to
> avoid fossilization. However, only once or twice were there many
> changes.
>
> Regards, John
>

To avoid fossilization, you might want to use ":runtime! menu.vim" (with
bang, and without quotes): that sources every menu.vim in all
'runtimepath' directories in turn, and in the order in which they appear
in 'runtimepath'.

However, for it to work, your menu has to be written in such a way that
it meshes gracefully with the default one, and possibly with any
additional menu added by 3rd-party plugins (e.g. I see "DrChip →
MathKeys → Enable" which doesn't exist in plain-vanilla Vim). You might
also want to place it in a "late" directory (e.g. ~/.vim/after/) so that
it can override $VIMRUNTIME/menu.vim and not vice-versa.


Best regards,
Tony.
--
Really heard in court in the U.S.A.:
Q.: She had three children, is that correct?
A.: Yes.
Q.: And how many of these children were boys?
A.: None of them.
Q.: Were there any daughters?
A.: Your Honor, I think I need another lawyer. Do you allow it?

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