delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/21/04:58:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4B07B995.3010301@tlinx.org>
Date: Sat, 21 Nov 2009 01:57:41 -0800
From: Linda Walsh <cygwin AT tlinx DOT org>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Lightning/0.9 Thunderbird/2.0.0.22 ThunderBrowse/3.2.6.5 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: Gary Johnson <garyjohn AT spocom DOT com>,
"cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: vim setup (getting cygvim and winvim happy together)
References: <4B061292 DOT 1060301 AT tlinx DOT org> <416096c60911192258xd6b36ecy6b212f10b18eb153 AT mail DOT gmail DOT com> <4B074F7A DOT 4060303 AT tlinx DOT org> <20091121064026 DOT GA7500 AT KCJs-Computer>
In-Reply-To: <20091121064026.GA7500@KCJs-Computer>
X-Stationery: 0.4.10
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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
> started.
---
	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:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019