On 09/30/2009 10:42 AM, Matt Wozniski wrote:
>
> On Tue, Sep 29, 2009 at 5:51 PM, Robert H wrote:
>>
>> On 9/28/09 6:06 PM, Matt Wozniski wrote:
>>>
>>> On Mon, Sep 28, 2009 at 5:16 PM, Robert H wrote:
>>>>
>>>> On 9/27/09 9:04 PM, pansz wrote:
>>>>>
>>>>> To be bug-free you must use the autocmd GUI Enter to do all .gvimrc
>>>>> related stuffs.
>>>>
>>>> I have probably never had an issue because I always launch the one I
>>>> want. I don't move from one to the other.
>>>
>>> Even so, some settings (like t_vb) must be set from either a .gvimrc
>>> or from a GuiEnter autocmd.  If they're set from .vimrc, they are
>>> silently reset to their original value when gvim is started.  So the
>>> only right ways to do it, for all options, is either with a .gvimrc
>>> file or with GuiEnter autocmds.
>>
>> There must be a lot of wrong wayers out there. Every example .vimrc that
>> I have seen that has a gui section does not prepend GuiEnter onto the
>> settings.
>
> Not necessarily "wrong way" - just not generic enough to work for all options.
>
>> Since this is all I am doing:
>>
>> if has("gui_running")
>>       set guioptions+=acegtm
>>       set guioptions-=T
>>       set guifont=Menlo:12
>>       set lines=50
>>       set columns=100
>>       set mouse=a
>>       autocmd GUIEnter * set vb t_vb=
>>       colorscheme desert
>> endif
>
> You set 8 options here, two of which are already done on GuiEnter
> instead of when the .vimrc file is first read.  So, somewhere along
> the way, you must have found out about this problem, and the GuiEnter
> work around.
>
> You chose not to use GuiEnter for the *other* 6 settings, because they
> worked.  But, short of trial-and-error or very in-depth knowledge,
> this isn't a great solution.  Using GuiEnter for everything is easier
> and less error-prone.
>
>> Do I really need more than that GUIEnter? If I do then how does that
>> change the above? Do I have multiple GUIEnter * set ... commands?
>
> In your case, no, you've already special-cased the 2 that need it.  In
> general, though, it's safest to set all GUI options inside one or more
> GuiEnter autocmds.  Which means, really, that it's easiest to just use
> a .gvimrc - you can think of a .gvimrc as just a file that gets
> :sourced from a GuiEnter autocmd; it's basically equivalent.
>

Except in that case I have to maintain two files and not one. Actually 
that one GUIEnter probably comes from another vimrc that I was looking at.



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to