This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: vim setup (getting cygvim and winvim happy together)

Gary Johnson wrote:
You could do that, or you could add the full path to the vim
directory to your PATH.
	This is a very circuitous story -- with different effects
developing over the years.  Things might be different under
cygwin 1.7, but I went through various kludges to get vim to
work everywhere I wanted it to.

	I had to search around to find why I did what I did.
	If I'm at the shell prompt, and type 'vi', I want the
Cygwin 'vim' shell version to come up.

If I type 'gvim', I want the Windows version to come
up. If I want to use the cygwin graphical version, I have to use an alternate name and -g, but I don't use it often, so not
a big deal.

But the problem with using the Gvim in /prog/vim
directly is that it doesn't auto-daemonize when invoked from
bash. So I wrote a program to call and fork it in background. But unfortunately, when vim would look for it's runtime, it looked at the path of the invoking
program which for compatibility as a replacement for
noteplad, had to sit in \windows\system32. Some programs only
looked in there for the system text editor and didn't look
at the path.

As a result, Vim didn't know where it's runtime was. So I had to set it in the env vars. to C:/prog/vim. (I keep my vim in
/prog/vim, not an every changing /prog/vim/vimX, because the registry
needs fixed paths.

So my various 'hacks' accumulated over the years do compensate
for various Windows programs that didn't use the path and/or that
required a fixed path for the editor.

There is something wrong there. That shouldn't be necessary.

I'm not sure which config files you mean.  Windows gvim uses
C:\Program Files\Vim\vim7 for its standard runtime files whereas
Cygwin vim uses /usr/share/vim/vim72.
	Like I said -- I moved them up a level, and 'program files'
dir is named 'prog', so it's in C:/Prog/vim.  (Win Vim accepts forward
slash as a path separator just as cygwin vim does).

	If I used VIMRUNTIME=C:\Prog\Vim, then cygwin vim sees
that as C:ProgVim.  Thus VIMRUNTIME=C:/Prog/Vim.

	Cygwin Vim doesn't handle CRLF, But WinVim understands
CRLF OR LF.  So WinVim get's it's RUNTIME converted to unix format
so that run time works with Cygwin's vim as well as Win Vim.

Basically WinVim is more adaptable than the cygwin version.
But I more often use the cygwin version for smaller edit sessions.
I use the win version for longer edit sessions (the color and fonts
are usually better), and for edits from other win programs.

There is no reason to share
those files between Windows and Cygwin versions of vim.
	At one point I was using customized versions of the runtime
before I figured out how to put them in my local dir.  But keeping
1 run time means I can update 1 runtime's files and both versions
will get updated. (spell files and such get shared as well).

They also share my home dir's .vimrc, .gvimrc, and .vimdir.

Sharing those makes sense (except that I don't know what .vimdir is).
	Forgot the name of it ...  I don't always refer to objects
by their exact name unless I'm looking right at them.  I forget names
but remember them conceptually and just look them up in my computer
when I need to actually know them.  .vimdir = '.vim', with 'vimfiles'
showing as a softlink .vim. (but it's an NT softlink) created
with 'linkd' -- the type of link some people was invented with Vista
but has been in Windows since 2k.

  You can also share .vim and vimfiles directories if you make
vimfiles a real directory and .vim a Cygwin symlink to vimfiles.
	I have them the other way around.

I think if you fixed your vim configuration to something not quite
so exotic, you might not have those problems.  Granted I'm using XP,
but I use both Cygwin 1.5 and 1.7 on different machines and I never
see problems with vim and gvim that depend on where or how they're
And you can start gvim from bash and have it background
like it does in 'cmd.exe'? And you can run it from the 'run command'?
And it comes up with you edit .txt files or .reg, or any
plain text file?

My registry's been pretty well honed for comfort, not
standardization. My home directory is named /home, not 'documents and settings'. My cygwin home shares my winhome. I'm trying to work
it so my linux home dir is also my profile dir -- which means my
cygwin /home dir would also be my linux server /home dir.

Yeah... I sometimes like to make things interesting,
but XP is like an old shoe -- on Win7 it's new territory. Tons
of books on the XP registry, but not so many on the Vista reg nor
any on the Win7 registry -- because no one knows anything. All
of the Win7 books out so far are (that I've seen) are user how-to manuals.

Anyway, hope this explains my vim setup (Recap:

Cygwin Vim shares Win-Vim's runtime dir because I have VIMRUNTIME set. That needs to be set, because
vim doesn't know how it was called. Why? Because...
it was called from a wrapper. Why? Because...
gvim won't daemonize under cygwin from it's shell.

Simple chain of logic...:-)

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]