On 23/10/08 22:15, fritzophrenic wrote:
>
>
> On Oct 23, 1:24 pm, John Degen<[EMAIL PROTECTED]>  wrote:
>> Thanks, your idea put me on the right track:
>>
>> The output of :verbose set showcmd was:
>> noshowcmd
>>       Last set from ~/.gvimrc
>>
>> which is strange, because both .gvimrc an .vimrc contain set showcmd.
>> But I found set nocompatible was set twice in both files. After
>> correcting this the command works as expected. Is this a bug you
>> think?
>>
>
> I don't think so.
>
> :help 'showcmd' says that the Vim default is "on, off for Unix"
>
> I've only been using Vim for about a year, so I'm not as familiar with
> this as others will be, but I think the following is correct:
>
> Doing a ":set nocompatible" will (re)set all options to Vim defaults.
> Since the .gvimrc is sourced _after_ the .vimrc, setting nocompatible
> in the gvimrc will reset all the options you painstakingly set in your
> vimrc. So setting nocompatible in a gvimrc at all is not generally a
> good idea. Setting nocompatible should happen only once, at the very
> beginning of a vimrc.
>
> Tony et al. will no doubt correct me if I'm wrong :-)

I think you're right. Since that option has "Vim default on, off for 
Unix; Vi default off", and since Vim regards Linux as a particular case 
of Unix, that option has the rare privilage that, on Linux, _both_ ":set 
compatible" and ":set nocompatible" will implicitly ":set noshowcmd".

As for the gvimrc, it is useful but not indispensable: it is usually 
enough to use, in the vimrc, ":if has('gui')" and/or ":if 
has('gui_running')" and/or ":au GUIEnter *" (followed of course by 
appropriate commands, and each of the three has a slightly different 
meaning).

Even setting 'nocompatible' at the start of a vimrc is normally not 
necessary, because Vim will ":set nocompatible" when a user .vimrc or 
_vimrc is found, unless of course the -C switch was used on the 
command-line. Note, however, that a nondefault vimrc (one given as 
argument to the -u switch) does _not_ automagically set 'nocompatible', 
so in that case you'll need -N if the file doesn't set the option 
explicitly. (Similarly when using -u NONE or -u NORC.)


Best regards,
Tony.
-- 
Yesterday upon the stair
I met a man who wasn't there.
He wasn't there again today --
I think he's from the CIA.

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

Reply via email to