Friday, October 29, 2010

Re: Problem sourcing .vimrc file

On Fri, Oct 29, 2010 at 06:29:26PM +0000, Jeffery Small wrote:
> I am on a Solaris 10 system using vim version 7.2.148.
>
> I have my master vimrc file identified by the environment variable VIMINIT
> and I also have a local .vimrc file in the current directory. When I begin
> editing a file in this directory, the custom commands in the local .vimrc
> file are read. However, if I edit the .vimrc file in another window and
> then source the file from my editing session with:
>
> :source .vimrc
>
> the changes are not read! Now, I have been doing this for many years and it
> always worked fine, so what is the problem now? I tried specifying:
>
> :source ./.vimrc

Neither of these will work unless the Vim process's CWD is the
directory where your .vimrc is stored. That, of course, should be
$HOME, and you can query the CWD with the :pwd command. It could be
the case that you have 'autochdir' set to true. See :help 'autochdir'
for more details.

That said,

> :source <full_directory_path>/.vimrc

should work, provided that you spelled <full_directory_path>
correctly.

> and neither of these worked. However, if I exit the editing session and
> restart vim, then the changes are seen upon startup!
>
> It appears as though the source command is not working. Is this a bug in
> this version of vim? Is there a new "feature" that I need to properly set
> that might be denying source from working? Is there a workaround for this?
> Thanks for any help you can offer.

The version of Vim that you're running is probably two years old. The
current version is 7.3.47. I don't know this off the top of my head,
but it could be a bug that has subsequently been fixed. You could
look at the patches section on www.vim.org to see if a patch was
submitted that fixes your problem.

At any rate, if it is possible to do so, I recommend that you upgrade
to 7.3.

--
Erik Falor
Registered Linux User #445632 http://counter.li.org

No comments:

Post a Comment