[R] R, Cygwin, & Vi

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Jan 31 17:05:55 CET 2011


We need to know much more (see the posting guide)

- What version of R?  Did you update recently?
- Are you running a Windows build of R, or did you compile your own 
from the sources as a Cygwin build?

On Mon, 31 Jan 2011, beehatch wrote:

> Hi all,
>
> I've been a happy user of R under cygwin for a number of years now.  I
> prefer the bash interface and readline history, and I find Vi to be the
> most efficient editor.

But I think you actually mean vim, a vi clone!

> Recently, the edit command has started giving me errors:
>
>> edit(file='foo.R')
> Error in edit(name, file, title, editor) : unable to run editor 'vi'
>
> Vi works from bash shell and is in the path. 'vi' is a symbolic link to
> the executable, so I tried specifying the full path using
> options(editor='c:/cygwin/bin/vim-nox.exe'):

Hmm, this suggests that you are running a Windows version of R: that 
is not supposed to be able to run 'symbolic links' (which are not even 
a Windows concept, and are part of the Cygwin emulation layer), and 
AFAIK never have.  I guess it was Cygwin that changed recently ....

>> edit(file='foo.R')
> NULL
> Warning message:
> In edit(name, file, title, editor) : editor ran but returned error
> status

Which is only a warning! Windows executables quite often do not follow 
the POSIX rules for return values, but Cygwin ones should.

> I've tried changing to another editor (ultraedit) and that works, but I'd
> like to get Vi working again.  Any suggestions for troubleshooting would
> be appreciated.
>
> Thanks in advance
> Matt

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list