Re: [vox-tech] using windows pathnames in cygwin

2006-02-01 Thread Jeff Newmiller

I see two issues: use of absolute paths, and a place for the gvim swapfile.

The swapfile error would probably not affect your ability to edit files
if you were using relative pathnames or the correct absolute pathnames.

More below.

Peter Jay Salzman wrote:

[..]


I tried calling the bat file by name:

   $ /cygdrive/c/WINDOWS/gvim.bat /cygdrive/c/boot.ini


The "/cygdrive/c" notation is a software fiction that only cygwin programs
understand.  Giving a non-cygwin program (such as your gvim.exe) an argument
that uses this fiction won't work.

If at all possible, specify filenames at or below your current directory
level using relative path names.  I find that working on files in the
current working directory is very easy and intuitive in all cases.

If you must use absolute paths, then arguments to non-cygwin programs
MUST be composed using the Windows directory structure... so your
commandline should be:

  $ /cygdrive/c/WINDOWS/gvim.bat /boot.ini

Note that the path used to find the batch file is interpreted by cygwin, so
it must use the /cygdrive/c/ fiction, and the argument is interpreted by
gvim.exe, so it can get away with using the implied "current drive" (C:)
and forward slashes are interchangeable with backslashes in filenames,
but it has to start at the root of the Windows drive.


and got the same result:

   Unable to open swap file for \cygdrive\c\boot.ini

and gvim left me editing an empty file.  I have a new job which leaves me
zilch free time, plus I have a two hour commute each way (ugh!) so I don't
have much time for experimentation these days.  I don't suppose you have a
magic pill for this?  :)


The vim documentation associates this with failure to set the
"directory" option to a valid value.  It appears
that you can create a C:\TMP directory if you normally
work on drive C, or change the directory option with the
"set" command to include the current directory or a "TMP"
directory that you can write to.

Because the vim website was running extremely slow this morning,
I am including the docs for the vim directory option for
your convenience:
(from http://www.vim.org/htmldoc/options.html#'directory')

-
*'directory'* *'dir'*
'directory' 'dir'   string  (default for Amiga: ".,t:",
 for MS-DOS and Win32: ".,c:\tmp,c:\temp"
 for Unix: ".,~/tmp,/var/tmp,/tmp")
global
List of directory names for the swap file, separated with commas.
- The swap file will be created in the first directory where this is
  possible.
- Empty means that no swap file will be used (recovery is
  impossible!).
- A directory "." means to put the swap file in the same directory
  as the edited file.  On Unix, a dot is prepended to the file
  name, so it doesn't show in a directory listing.  On
  MS-Windows the "hidden" attribute is set and a dot
  prepended if possible.
- A directory starting with "./" (or ".\" for MS-DOS et.al.)
  means to put the swap file relative to where the edited file
  is.  The leading "." is replaced with the path name of the
  edited file.
- For Unix and Win32, if a directory ends in two path separators,
  the swap file name will be built from the complete path to
  the file with all path separators substituted to percent
  '%' signs.
  This will ensure file name uniqueness in the preserve directory.
- Spaces after the comma are ignored, other spaces are
  considered part of the directory name.  To have a space at
  the start of a directory name, precede it with a backslash.
- To include a comma in a directory name precede it with
  a backslash.
- A directory name may end in an ':' or '/'.
- Environment variables are expanded |:set_env|.
- Careful with '\' characters, type one before a space, type two to
  get one in the option (see |option-backslash|), for example:
  :set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
- For backwards compatibility with Vim version 3.0 a '>' at the
  start of the option is removed.
Using "." first in the list is recommended.  This means that editing
the same file twice will result in a warning.  Using "/tmp" on
Unix is discouraged: When the system crashes you lose the swap file.
"/var/tmp" is often not cleared when rebooting, thus is a better
choice than "/tmp".  But it can contain a lot of files, your swap
files get lost in the crowd.  That is why a "tmp" directory in your
home directory is tried first.
The use of |:set+=| and |:set-=| is preferred when adding or
removing directories from the list.  This avoids problems when a
future version uses 

Re: [vox-tech] using windows pathnames in cygwin

2006-02-01 Thread Foo Lim
On 2/1/06, Peter Jay Salzman <[EMAIL PROTECTED]> wrote:
On Tue 31 Jan 06,  2:03 PM, Foo Lim <[EMAIL PROTECTED]> said:>Hi Pete,>>When I installed gvim, I also installed the bat files for running from the
>command line.  It's an option when installing gvim.  It puts batch files>in the Windows directory, so you can merely run:>>gvim.bat file>>I have successfully aliased vi to /cygdrive/c/WINDOWS/gvim.bat, & it
>works.>>FooHi Foo,This is *exactly* what I want, but unfortunately it's not working for me.  Itried calling the bat file by name:   $ /cygdrive/c/WINDOWS/gvim.bat /cygdrive/c/boot.ini
and got the same result:   Unable to open swap file for \cygdrive\c\boot.iniand gvim left me editing an empty file.  I have a new job which leaves mezilch free time, plus I have a two hour commute each way (ugh!) so I don't
have much time for experimentation these days.  I don't suppose you have amagic pill for this?  :)Thanks!PeteHi Pete,This sounds like a permissions issue.  Are you part of the Administrators group?  The swap file should be created in the directory of the file you're editing.  What if you put
set noswapfilein the _vimrc file in the Vim install directory?Foo
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] using windows pathnames in cygwin

2006-02-01 Thread Peter Jay Salzman
On Tue 31 Jan 06,  2:03 PM, Foo Lim <[EMAIL PROTECTED]> said:
> >On 1/31/06, Peter Jay Salzman <[EMAIL PROTECTED]> wrote:
> >
> >  In cygwin, I'd like to type "vi /etc/profile" and have gvim come up,
> >  editing
> >  /etc/profile without necessarily running X.  That means I need to rely
> >  on a
> >  win32 installation of gvim, rather than the gvim that comes with cygwin.
> >
> >  I've installed win32 gvim in C:\Program Files\vim, but when I do:
> >
> > /cygdrive/c/Program\ Files/Vim/vim64/gvim.exe /etc/profile
> >
> >  gvim comes up with:
> >
> > "Cannot open swap file for \etc\profile", recovery impossible
> >
> >  and I find myself editing an empty file.  Eventually, I'd like to make
> >  "/usr/bin/vi" an alias for "/cygdrive/c/Program
> >  Fiels/Vim/vim64/gvim.exe".
> >
> >  Is there a way to use win32 gvim from within cygwin and have the
> >  pathnames
> >  work out?
> 
>Hi Pete,
> 
>When I installed gvim, I also installed the bat files for running from the
>command line.  It's an option when installing gvim.  It puts batch files
>in the Windows directory, so you can merely run:
> 
>gvim.bat file
> 
>I have successfully aliased vi to /cygdrive/c/WINDOWS/gvim.bat, & it
>works.
> 
>Foo

Hi Foo,

This is *exactly* what I want, but unfortunately it's not working for me.  I
tried calling the bat file by name:

   $ /cygdrive/c/WINDOWS/gvim.bat /cygdrive/c/boot.ini

and got the same result:

   Unable to open swap file for \cygdrive\c\boot.ini

and gvim left me editing an empty file.  I have a new job which leaves me
zilch free time, plus I have a two hour commute each way (ugh!) so I don't
have much time for experimentation these days.  I don't suppose you have a
magic pill for this?  :)

Thanks!
Pete
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech