Ben Schmidt schrieb am 15.12.2008 um 09:59:30 (+1100):
> Michael Ludwig wrote:
>> I'm running Windows XP pluc Cygwin, maintaining my Vim configuration
>> in the Cygwin home directory, and sourcing it from Windows.
>> 
>>   C:\ :: type "%userprofile%\_vimrc"
>>   set nocompatible
>[...]
>>   source C:\cygwin\home\michael\repos5ak\config\.vimrc
>
>> The loading order can be seen by entering ":script". On Cygwin:

>>   5: /home/michael/repos5ak/config/.vim/filetype.vim    # custom first
>>   6: /usr/share/vim/vim71/filetype.vim                  # system second

>> But on Windows, "filetype.vim" is first loaded from the Vim
>> distribution directory:

>>   6: C:\Programme\Vim\vim72\filetype.vim                        # system
>>   7: C:\cygwin\home\michael\repos5ak\config\.vim\filetype.vim   # custom

> Is C:\cygwin\home\michael\repos5ak\config the same location as
> /home/michael?

They're symlinked:

mich...@wladimir:~ :-) ls -ld .vim*
lrwxrwxrwx 1 michael Kein   11 Aug 11  2007 .vim -> config/.vim
-rw------- 1 michael Kein 8324 Dec 14 21:42 .viminfo
lrwxrwxrwx 1 michael Kein   13 Feb 22  2006 .vimrc -> config/.vimrc

I know, I know, it's not a real symlink; we're on NTFS, so it's a
shortcut file.

C:\cygwin\home\michael :: dir .vim*
11.08.2007  17:32               527 .vim.lnk
14.12.2008  21:42             8.324 .viminfo
22.02.2006  21:27               407 .vimrc.lnk
               3 Datei(en)          9.258 Bytes

To Cygwin applications, these are symlinks. The Windows Vim, however,
can't work with the shortcut file; it needs the real path, so that's
what I feed it.

> Does C:\cygwin\home\michael\repos5ak\config\.vimrc have the same
> content as /home/michael/.vimrc?

Yes, because the latter is a symlink to the former.

> Perhaps you are inadvertently sourcing different files, and you should
> be sourcing C:\cygwin\home\michael\.vimrc? That would explain why the
> results are unchanged when you change that file.

Changes in my Cygwin .vimrc are reflected in both the Cygwin and the
Windows Vim. The only thing I'm aware of that doesn't work is the
"filetype.vim" resolution order.

> Can you manually check the values of all the relevant options and
> variables are as you expect after starting Vim in both cases?:
> 
> :echo $HOME
> :echo $VIM
> :echo $VIMRUNTIME
> :echo &rtp

For Cygwin:

/home/michael
/usr/share/vim
/usr/share/vim/vim71
/home/michael/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim71,/usr/share/vim/vimfiles/after,/home/michael/.vim/after

And for Windows:

C:\Dokumente und Einstellungen\michael
C:\Programme\Vim
C:\Programme\Vim\vim72
C:/cygwin/home/michael/repos5ak/config/.vim,C:\Programme\Vim\vim72

> I expect it is some kind of configuration problem, as looking at Vim's
> source code, there is no reason I can see why the runtimepath order
> would go wrong.
> 
> Your runtimepath is far from ideal, too. Something more like this
> would be better:
> 
> let $HOME=C:/cygwin/home/michael/repos5ak/config
> set 
> rtp=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after

Thanks for the suggestions. Trying to find a solution to this rtp
problem, I've stumbled upon this "after" directory feature, which is
documented under ":help after-directory".

> Most importantly, it keeps the after-directory in the list. The
> system-wide vimfiles is also included. Advice you get on this list, on
> the tips Wiki, in the help, etc. will assume you have a runtimepath
> much like this.

I'll add it to the list. My configuration likely is a bit dated. Haven't
RTFM with all the great updates and enhancements released since I've
started using Vim, only accidentally discovering new features. I'll do
better in the feature.

Of course, I can simply do the following:

M:\ :: md vimfiles
M:\ :: copy y:repos5ak\config\.vim\filetype.vim vimfiles
        1 Datei(en) kopiert.

This works, of course. But I have this stupid obstination to find a
non-kludgy solution, and failing to do so myself, I came here.

Thanks,

Michael Ludwig

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

Reply via email to