some option settings have to be at about bottom of vimrc file.

9 views
Skip to first unread message

Dewr

unread,
Oct 10, 2009, 1:38:06 AM10/10/09
to v...@vim.org
some option settings have to be at about bottom or last of vimrc file! What is this??
I appended my vimrc file to this mail.
be happy.

<examples>
set nobackup "***?! This code have to be bottom of vimrc

" Tell vim to remember certain things when we exit. this must be the last code in vimrc.
"  '16 : marks will be remembered for up to 16 previously edited files
"  "1000 : will save up to 1000 lines for each register
"  :20 : up to 20 lines of command-line history will be remembered
"  % : saves and restores the buffer list
"  n... : where to save the viminfo files
set viminfo='16,\"1000,:20,%,n~/_viminfo
</examples>

Tim Chase

unread,
Oct 10, 2009, 7:45:09 AM10/10/09
to vim...@googlegroups.com
> some option settings have to be at about bottom or last of
> vimrc file! What is this?? I appended my vimrc file to this
> mail. be happy.
>
> <examples> set nobackup "***?! This code have to be *bottom*
> of vimrc

My guess is that somewhere higher in your vimrc, you source some
other file like

so example_vimrc

or

source example_vimrc

which changes the option. If you remove/comment *your* line in
question (such as "set nobackup") from your vimrc, start vim, and
then type

:verbose set backup?

it should tell you which script was changing it before you got a
crack at it. Just make sure your preferences are set after
sourcing this file.

-tim


Dewr

unread,
Oct 11, 2009, 7:53:17 AM10/11/09
to vim_use
Thank you very much! these codes were in example_vimrc.

<code>
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif
</code>

On Oct 10, 8:45 pm, Tim Chase <v...@tim.thechases.com> wrote:
> > some option settings have to be at aboutbottomor last of

Tim Chase

unread,
Oct 11, 2009, 8:06:39 AM10/11/09
to vim...@googlegroups.com
> Thank you very much! these codes were in example_vimrc.

Then all you have to do is either

1) move the "source example_vimrc" to the top of your vimrc (my
preferred solution because it will help prevent similar issues if
they would normally appear later) or

2) make sure that your "set nobackup" comes after the "source
example_vimrc" regardless of where they are in the file

-tim


Tony Mechelynck

unread,
Nov 8, 2009, 1:57:43 AM11/8/09
to vim...@googlegroups.com
On 11/10/09 14:06, Tim Chase wrote:
[Dewr wrote]

In fact, if (like me) you source the vimrc_example.vim (the real name of
that file), there are very _few_ settings which need to be before it, so
it can be near the top of your vimrc (and it should, so, like Tim said,
any option you set yourself in your vimrc will override the example
vimrc's setting and not vice-versa).

One of the very few settings which need to be before sourcing the
example vimrc rather than after it is setting the menu and messages
language, because that must happen before defining the menus, and the
example vimrc sets them up (implicitly, via "filetype plugin indent on"
and "syntax on").


Best regards,
Tony.
--
Although the moon is smaller than the earth, it is farther away.

Reply all
Reply to author
Forward
0 new messages