Friday, July 23, 2010

Re: Request for Win Gvim to match *nix re: .vimrc/.gvimrc/.vim

On 23/07/10 14:13, Maxim Kim wrote:
>
>
> On 23 июл, 05:49, Linda W<v...@tlinx.org> wrote:
>> I'd like to try to reuse my files as much as possible w/o
>> modications, so when files go missing or I need to reinstall in a
>> new dir or such, I can just tar or zip up one dir or just use 'cp
>> -a' from the linux dir to the windows dir.
>>
>> Gvim does look for and use .vim/.gvim (though it doesn't look for
>> them first, as I wish it would) -- but it doesn't seem to look for
>> .vim at all -- I thought it used to, but I can't verify that so it
>> might have been imagined.
>>
>> So can it be brought up to conform with the *nix version and look
>> for the ".vim{/,rc}" versions, and if they don't exist, then look
>> for the DOS compatible file names?
>
> I have the following lines in my .vimrc:
>
> " use .vim folder instead of vimfiles on windows. if !has("unix") set
> rtp& let&rtp = expand('~/.vim').','.&rtp.','.expand('~/.vim/after')
> endif
>

When I was on dual-boot I used the converse (notice the use of the 8.3
name for "Documents and Settings" in order to avoid troublesome spaces
in the path):

cd $HOME
ln -sv /mnt/dos/c/DOCUME~1/tony/vimfiles .vim
ln -sv /mnt/dos/c/DOCUME~1/tony/_vimrc .vimrc

the idea being that a Linux kernel can read a FAT32 or NTFS filesystem
(once it is mounted: here the Windows C: partition on /mnt/dos/c,
obviously), but a Windows kernel cannot read the usual filesystems used
on Linux (ext2, later reiserfs, ext3, ext4, etc.). Also (at that time,
and with that version of Windows) soft links existed in Linux but not
Windows, and hard links (I learnt much later) existed on NTFS but were
as good as undocumented.

This, of course, meant creating all scripts (vimrc, gvimrc if present,
*.vim) with Unix-style LF-only ends-of-lines, since Windows Vim can
source that but Unix Vim cannot source scripts with Dos-style CRLF
ends-of-lines.

And other portability issues should be taken care of when they arise --
in the Vim fasion, usually by testing has('unix') or similar.


Best regards,
Tony.
--
Nondeterminism means never having to say you are wrong.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment