Re: [vox-tech] using windows pathnames in cygwin
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
Re: [vox-tech] using windows pathnames in cygwin
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 filesin the Windows directory, so you can merely run:gvim.bat fileI 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
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 another default. This option
[vox-tech] using windows pathnames in cygwin
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? Thanks, Pete ___ 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
Peter Jay Salzman 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 This error seems like an odd way to say it couldn't find a file. If that isn't what it is saying, then something is wrong with your install of gvim. 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? This would be my normal invocation: $ /cygdrive/c/Program\ Files/Vim/vim64/gvim.exe C:/cygwin/etc/profile I've never used gvim.exe, but one of the issues that comes up in using Windows versions of posix tools in cygwin is the newline problem... the windows versions may or may not handle the normal cygwin LF newlines properly. gvim probably can... others don't always. You may be able to get what you are after with a script that prepends C:/cygwin/ to the first argument if it begins with a /. I don't know how you can completely forget that Windows is there... it doesn't let me forget, and I am just resigned to that. -- --- Jeff NewmillerThe . . Go Live... DCN:[EMAIL PROTECTED]Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- ___ 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
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 awin32 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/profilegvim 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 fileI have successfully aliased vi to /cygdrive/c/WINDOWS/gvim.bat, it works.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
On Tue, Jan 31, 2006 at 04:37:03PM -0800, Jeff Newmiller wrote: I've never used gvim.exe, but one of the issues that comes up in using Windows versions of posix tools in cygwin is the newline problem... the windows versions may or may not handle the normal cygwin LF newlines properly. gvim probably can... others don't always. Can't you use set fileformat? ___ 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
Micah J. Cowan wrote: On Tue, Jan 31, 2006 at 04:37:03PM -0800, Jeff Newmiller wrote: I've never used gvim.exe, but one of the issues that comes up in using Windows versions of posix tools in cygwin is the newline problem... the windows versions may or may not handle the normal cygwin LF newlines properly. gvim probably can... others don't always. Can't you use set fileformat? I don't know... in what context? As a gvim command? Quite possibly... but as I said I don't use gvim so you tell me... I figured gvim would be smart enough to handle alternate newline types in edited files, though it might not be so forgiving in configuration files. As a cygwin bash command? I am not aware of something like that... there are mount options and installation settings for defaulting to unix or dos handling of text files, with unix being recommended, but then unix utilities compiled outside of cygwin don't pay any attention to that and do whatever they were compiled to do. This has been an issue for me with ActiveState Perl, which is a separately-compiled Windows program that uses CRLF and windows paths, while my cygwin installation generally produces LF delimited files that ASPerl handles fine as input data but not as source code. I found ASPerl handled crlf data more conveniently than cygwin perl does on the whole, though. -- --- Jeff NewmillerThe . . Go Live... DCN:[EMAIL PROTECTED]Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- ___ 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
On Tue, Jan 31, 2006 at 06:49:08PM -0800, Jeff Newmiller wrote: Micah J. Cowan wrote: On Tue, Jan 31, 2006 at 04:37:03PM -0800, Jeff Newmiller wrote: I've never used gvim.exe, but one of the issues that comes up in using Windows versions of posix tools in cygwin is the newline problem... the windows versions may or may not handle the normal cygwin LF newlines properly. gvim probably can... others don't always. Can't you use set fileformat? I don't know... in what context? As a gvim command? Quite possibly... but as I said I don't use gvim so you tell me... Ah. I missed that. In the context of POSIX tools in cygwin, then: when you install cygwin, it gives you the option of whether to use Windows or Unix line-endings, so that's probably a source of your trouble. I don't know where you go to reconfigure that. -- Micah J. Cowan [EMAIL PROTECTED] ___ 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
On Tue, Jan 31, 2006 at 02:17:49PM -0800, Micah J. Cowan wrote: I've got a shortcut on my desktop that launches X with an xterm. I'm pretty sure I found it in either $CYGROOT/usr/bin or $CYGROOT/usr/X11R6/bin. I'll let you know what it is when I get home, unless you find it first. You should have a file startxwin.bat in your /usr/X11R6/bin. Copy a shortcut to that to your desktop. snip However, it may interest you to know that the fact that xterm and other clients pop up alongside the other Windows apps is a relatively recent /feature/ (root-less X). You can disable it in your XF86Config, I believe. Apparently, you can get the right setting by editing the invocation of XWin in the startxwin.bat file I just mentioned the -multiwindow option is what you probably have enabled, and activates the integrated Windows-based window manager. The -rootless option actually uses a /transparent/ root window with an external window manager. You probably want to use the -fullscreen option, which does the normal X thing. Then you'd want to replace the (commented-out) line that starts twm with whatever wm you'd like to enjoy. HTH, Micah ___ 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
On Tuesday 31 January 2006 01:28 pm, p-at-dirac.org \(Peter Jay Salzman\) |lugod| 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 I _THINK_ the problem here is that gvim isn't a cygwin app, and doesn't know where /etc is. 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? This, I do not know. -- Ryan Castellucci - http://ryanc.org/ GPG Key: http://ryanc.org/files/publickey.asc ___ 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
Peter Jay Salzman wrote: On Tue 31 Jan 06, 1:37 PM, Micah J. Cowan [EMAIL PROTECTED] said: On Tue, Jan 31, 2006 at 04:28:15PM -0500, Peter Jay Salzman 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 Files/Vim/vim64/gvim.exe. Is there a way to use win32 gvim from within cygwin and have the pathnames work out? Crap. Probably not. What I'd recommend is writing a wrapper script that translates the paths for you. Which might be more work than it's really worth. Myself, I've been using the X version of gvim under cygwin. I hate using the DOS-console-running-bash method; I could never get the control sequences to work the way I wanted. So, I always have X running with xterm anyway; might as well take advantage of it. i've never really used cygwin before. how exactly is X supposed to work? i've run 'startx' just because i didn't know what else to do. got something that looked like an xterm and was able to run cygwin's gvim from that. but it seems ... very unsatisfying. is there a way to just let cygwin take over the entire window? how do you have your cygwin/windows environment set up? i'd like to emulate someone's setup who has something comfortable. don't have the luxury anymore for massive experimentation like i used to. I recently started trying to use cygwin myself. While Googling I noticed a lot of recommendations to use the rxvt terminal. It seems fine, like xterm but with a sidescroller bar. I also discovered that X and an x-based terminal can be started immediately by running: cygwin\usr\X11R6\bin\startxwin.bat I edited this file to start the rxvt terminal rather xterm. This is now what I execute whenever I want to use cygwin now. I quickly get an rxvt terminal that can launch x-apps if desired. I did read that you can start X in such a way that you get a big X window that takes up the screen. I don't have much use for this myself. Two resources I found helpful were: www.zieg.com/faqs/cygwin/ x.cygwin.com Hope this helps. Sorry if I repeated information that someone else gave; I didn't take time to read all the posts to this thread :( Jonathan ___ vox-tech mailing list vox-tech@lists.lugod.org http://lists.lugod.org/mailman/listinfo/vox-tech