[EMAIL PROTECTED] wrote:
"A.J.Mechelynck" <[EMAIL PROTECTED]> 写于 2007-05-19 15:42:15:
This is true, but rather than an empty vimrc I suggest the following:

runtime vimrc_example.vim
" if and when we want to further customize Vim, we'll add more lines
below
Best regards,
Tony.
--

I always recommend include the contents of vimrc_example.vim instead of
just source the file by :runtime.

By including the contents of vimrc_example.vim we know all it has done and
we can change it anyway. i.e. chang the .vimrc is a good way, changing the
$VIMRUNTIME/vimrc_example.vim is NOT a good pratice. (vimrc_example fits
the need of the author but it definetely do not fit everyone, so I suggest
most users to change it and create their own .vimrc.)

The second reason: vimrc_example.vim comes from the distribution and it may
change, when it change it may silently break our existing scripts or
configurations. include the contents into our .vimrc minimize the
incompatible changes.

So the better practise to create a new .vimrc may be: just copy the
vimrc_example.vim to ~/.vimrc
--
Sincerely, Pan, Shi Zhu. ext: 2606



Changing the vimrc_example.com is not a good practice, but I prefer sourcing (contrary to Bram's repeated advice) because that way, if an improvement is distributed, I don't remain stuck with the old version. If the vimrc_example does something I don't want (and sometimes it does) I reverse it in the part of my own vimrc after the sourcing: for instance, to avoid filetype-specific indenting:

        ...
        runtime vimrc_example.vim
        filetype indent off
        ...

Likewise for other options. If I want to check what the vimrc_example actually does, I can always use ":view $VIMRUNTIME/vimrc_example.vim"; but that script is long, complex, and not written by me, enough for me to want it kept apart from my own changes -- and in a different file.

I don't remember the vimrc_example introducing changes which broke my own scripts, but if it did, ":verbose set optionname" would quickly tell me that 'optionname' whas set there. YMMV.

Which practice is "better" depends on by which criteria you judge those practices. According to my criteria, sourcing the vimrc_example is "better" than copying it. Bram doesn't agree with me on that point, and neither do you, because you apply different criteria.


Best regards,
Tony.
--
The best book on programming for the layman is "Alice in Wonderland";
but that's because it's the best book on anything for the layman.

Reply via email to