Discussion:
Using gvim as editor on Windows 7
Daryl Lee
2011-06-23 21:22:51 UTC
Permalink
I just bought the newly announced book "GNU Octave Beginner's Guide" and
discovered I should be able to redefine the default editor. My preferred
editor is gvim, and I'm on Windows 7, Octave 3.2.4. I have not been able to
work out the syntax for passing a filename to gvim for editing. Here's what
I've done:

edit editor "gvim"
edit .octaverc

With that I get "Create process failed..."

So I spelled out the path:

edit editor "C:\\Program Files (x86)\\Vim\\vim73\\gvim.exe"
edit .octaverc

With that I get a nice gvim editor, but no file opened, and this in the console:

warning: edit: some elements in list of return values are undefined
error: matrix cannot be indexed with .

So I add %s to the command:

edit editor "C:\\Program Files (x86)\\Vim\\vim73\\gvim.exe %s"
edit .octaverc

And that has no effect (gvim launched, no file, and same warnings).

I'm sure I'm missing something. I know the authors of the book targeted
Linux, so I'm wondering if someone has suggestions on how to do this with
Windows?
--
Daryl Lee
Ben Abbott
2011-06-24 13:11:42 UTC
Permalink
Post by Daryl Lee
edit editor "gvim"
edit .octaverc
With that I get "Create process failed..."
edit editor "C:\\Program Files (x86)\\Vim\\vim73\\gvim.exe"
edit .octaverc
warning: edit: some elements in list of return values are undefined
error: matrix cannot be indexed with .
edit editor "C:\\Program Files (x86)\\Vim\\vim73\\gvim.exe %s"
edit .octaverc
And that has no effect (gvim launched, no file, and same warnings).
I'm sure I'm missing something. I know the authors of the book targeted Linux, so I'm wondering if someone has suggestions on how to do this with Windows?
--
Daryl Lee
I haven't tried this on WIndows, but with MacOS my octaverc contains ...

edit editor "mvim %s"
edit mode async

Perhaps you just need to add the second line?

Ben
Daryl Lee
2011-06-24 14:04:56 UTC
Permalink
Thanks again! This is indeed a voyage of discovery. I know you and the
experienced readers will know all this, but for the benefit of other newbies
coming along:

The reason "edit .octaverc" came up empty is that that file is in the home
directory (~/), which is not in the search path. "edit ~/.octaverc" works
just fine, when the full path to gvim is specified. So note to self: learn
when search path is used. It seems NOT to be used in "source('.octaverc')",
for instance, but IS used in "edit foo.m".

Ironically, my next effort was "edit test.m", which turns out to actually
exist in the search path, somewhere inside the Octave folder. That really
surprised me (and helped me figure out what was going on).

Thanks for the help. There's a lot to learn here.
Post by Ben Abbott
Post by Daryl Lee
edit editor "gvim"
edit .octaverc
With that I get "Create process failed..."
edit editor "C:\\Program Files (x86)\\Vim\\vim73\\gvim.exe"
edit .octaverc
warning: edit: some elements in list of return values are undefined
error: matrix cannot be indexed with .
edit editor "C:\\Program Files (x86)\\Vim\\vim73\\gvim.exe %s"
edit .octaverc
And that has no effect (gvim launched, no file, and same warnings).
I'm sure I'm missing something. I know the authors of the book targeted Linux, so I'm wondering if someone has suggestions on how to do this with Windows?
--
Daryl Lee
I haven't tried this on WIndows, but with MacOS my octaverc contains ...
edit editor "mvim %s"
edit mode async
Perhaps you just need to add the second line?
Ben
--
Daryl Lee
www.daryllee.com
The unexamined life is not worth living. -- Socrates
The unlived life is not worth examining. -- Unknown
Loading...