define HOME environment variable on windows to point to your home dir.
Put your .vimrc to the %HOME% directory. Create %HOME%/.vim directory,
put your vimfiles there as usual.
Insert following into the _beginning_ of your .vimrc:
if has("gui_running") && has("win32")
" to help win32-gui to locate d:\anton\.vim\{color,compiler,...}
" additionally - environment variable must be set:
" set HOME=d:\anton
set runtimepath+=~/.vim
endif
PS: In my setup it is even shared between cygwin / w32-gui gvim. And I
use Subversion to have it one-to-one on all my linux computers.
--
Mit freundlichen GrьЯen
Anton Sharonov
mailto:anton.s...@gmail.com
set runtimepath+=~/.vim
works for me even w/o defining HOME outside gvim; gvim somehow
has $HOME already defined.
> PS: In my setup it is even shared between cygwin / w32-gui gvim. And I
> use Subversion to have it one-to-one on all my linux computers.
yep, that's cool. especially if that repositore is on the "colud"
On Windows, the user-specific directory is not $HOME/.vim but
$HOME/vimfiles. If you want to use the same user-written scripts on both
sides of a double-boot computer, put them at $HOME/vimfiles on the
Windows side, with appropriate has() and/or exists() checks inside to
handle each system's idiosyncrasies, and create softlinks from ~/.vim on
the Linux side to wherever the Windows $HOME/vimfiles will be mounted
when Linux is running -- when I used double-boot it meant
cd ~
ln -sv /mnt/dos/c/Documents\ and\ Settings/Tony/My\
Documents/Home/vimfiles .vim
You may decide to mount that vfat or ntfs filesystem elsewhere and/or to
have your %HOME% directory elsewhere (the above was not the Windows default)
$VIM/vimfiles (which is system-wide) is a name common to both, but of
course it will resolve differently, as /usr/local/share/vim on one side
and as "C:\Program Files\Vim" (which is not even on the same filesystem)
on the other side. Similarly, both $VIMRUNTIME directories will be
$VIM/vim72 but they won't be the same either.
Best regards,
Tony.
--
A celebrity is a person who is known for his well-knownness.
On Wed, Sep 3, 2008 at 10:46, Anton Sharonov <anton.s...@gmail.com> wrote:
>
>> Hello!
>> I use vim on both windows/linux platforms. My personal configuration file for
>> vim is ~./.vimrc on both platforms; Why should then ~/.vim/colors, plugins, etc.
>> are processed only on linux platform and not on windows?
>> What should be configured to make vim process them on windows also?
This is not a very good idea.
It will add ~/.vim to the end of runtimepath, but it should be at the
beginning of it, and ~/.vim/after should be at the end.
I suggest either using vimfiles instead of .vim on Windows, which is
what Vim defaults to using on that platform (make a link for Linux use),
or put this in your .vimrc instead:
let &rtp=substitute(&rtp,'[\\/]\zsvimfiles\ze\([\\/,]\|$\)','.vim','g')
which should change the appropriate 'vimfiles' into '.vim' in your runtime
path rather than adding '.vim' in the wrong place. I haven't tested it
though (it's tricky without being on Windows!).
Ben.
This might not be very helpful, but I have a copy of my vimfiles
directory in ~/.vim (on Linux), c:\cygwin\home\al\.vim (for cygwin)
and C:\vim\vimfiles (for Windows). They're all linked with subversion
(and vimrc is in the vimfiles directory and merely linked to by the
default location). Cygwin vim uses c:\cygwin\home\al\.vim whereas
Windows Vim uses c:\vim\vimfiles and it all works very nicely.
http://vim.wikia.com/wiki/Version_Control_for_Vimfiles
Al
Ben ! Thanks a _lot_ for your substitute command, I have already put
it into my .vimrc as replacement of my version. That's again one
example why I love this list. One thing what I not
understand is : why I have no problems using my former setting ?
Is it because I never used any */after/* functionality ?
Anyway, I have briefly tested it -
at least w32 gvim is still startable and finds my colorscheme and seems
to works. If there will be some problems with it, I will report them here.
At the beginning I have also used symlinks _vimrc -> .vimrc, vimfiles
-> .vim, but flat structure, which I have now is for me huge advantage
in usability, especially since I start to directly share ~/.vimrc
~/.vim with cygwin vim without necessity of "svn update" for some
another directories. Single
caveat (exactly how it is mentioned on George V. Reilly blog page), is
that one must always checkout vim files using cygwin svn to get unix
EOL's in all files with svn:eol-style=native (or process them all with
- untested - find ~/.vim -iname '*.vim' | xargs dos2unix).
Symlinks _vimrc <-> .vimrc are not necessary if the directory can be
found, becaure if .vimrc cannot be found, Unix Vim will look for _vimrc,
and vice-versa for Windows. A symlink .vim -> vimfiles can be useful in
some cases (and remember that Linux can read fat and ntfs filesystems,
but Windows cannot read ext2, ext3, reiser, etc.).
Best regards,
Tony.
--
"Life is like a buffet; it's not good but there's plenty of it."
You're welcome.
> That's again one
> example why I love this list. One thing what I not
> understand is : why I have no problems using my former setting ?
> Is it because I never used any */after/* functionality ?
It would work if you never used any */after/* functionality, and if all
the regular functionality you used didn't rely on running before the
distributed runtime files. A good number of examples in the help and
that people give on this list do rely on that, however, and a messed-up
runtimepath would be one of the last things we'd think to check when it
didn't work!
Smiles,
Ben.
At the beginning I have also used symlinks _vimrc -> .vimrc, vimfiles
-> .vim, but flat structure, which I have now is for me huge advantage
in usability, especially since I start to directly share ~/.vimrc
~/.vim with cygwin vim without necessity of "svn update" for some
another directories. Single
caveat (exactly how it is mentioned on George V. Reilly blog page), is
that one must always checkout vim files using cygwin svn to get unix
EOL's in all files with svn:eol-style=native (or process them all with
- untested - find ~/.vim -iname '*.vim' | xargs dos2unix).
Symlinks _vimrc <-> .vimrc are not necessary if the directory can be
found, becaure if .vimrc cannot be found, Unix Vim will look for _vimrc,
and vice-versa for Windows. A symlink .vim -> vimfiles can be useful in
some cases (and remember that Linux can read fat and ntfs filesystems,
but Windows cannot read ext2, ext3, reiser, etc.).
And one more trick, if one uses both cygwin vim and w32 gvim: to
share physically the same configuration files between cygwin vim
and w32 gvim one can checkout those files using cygwin
(/usr/bin/svn) svn client, which will create all files with UNIX
EOL's by default. Than both cygwin vim and w32 gvim are able to
work with them properly. If *.vim files are checked out using
windows svn client (for example TortoiseSVN), files are created
with WINDOWS EOL's and are usable only from w32 gvim and not from
cygwin vim. Thats working copy, where *.vim files have WINDOWS
EOL's, can be fixed either by removing the working copy and
checking it out once more using cygwin svn client, or by using
following command from cygwin shell
- untested - find ~/.vim -iname '*.vim' | xargs dos2unix.
2008/9/4, George V. Reilly <geo...@reilly.org>:
I'm confused as to why all this is needed.
Vim (and most other modern Windows programs) work perfectly fine with
files encoded with Unix line endings.