External Editor support

7 views
Skip to first unread message

Wink Saville

unread,
Jun 11, 2020, 3:57:52 PM6/11/20
to Curv
I see an old post that someday there might be a GUI. I might have missed it, but seems that has been delayed, which is a "good thing" IMHO as editors are very personal.

What I'd like is something like what OpenSCAD does. So is there support for external editors where the "preview" window listens for file changes and updates the display?


Doug Moen

unread,
Jun 11, 2020, 4:11:14 PM6/11/20
to Curv
This is called "live editing mode", using the "-le" command line flag.
It's described right at the beginning of the main documentation file.

No GUI yet, but I still want a simple GUI that approximates the OpenSCAD layout.

On Thu, Jun 11, 2020, at 3:57 PM, Wink Saville wrote:
I see an old post that someday there might be a GUI. I might have missed it, but seems that has been delayed, which is a "good thing" IMHO as editors are very personal.

What I'd like is something like what OpenSCAD does. So is there support for external editors where the "preview" window listens for file changes and updates the display?



--
You received this message because you are subscribed to the Google Groups "Curv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to curv+uns...@googlegroups.com.

Wink Saville

unread,
Jun 11, 2020, 4:36:45 PM6/11/20
to Curv
I've used the "live editing" mode but the default editor is "gedit" and I want to use "vim" or "visual studio code", is there a way to change the default editor?

On Thursday, June 11, 2020 at 1:11:14 PM UTC-7 Doug Moen wrote:
This is called "live editing mode", using the "-le" command line flag.
It's described right at the beginning of the main documentation file.

No GUI yet, but I still want a simple GUI that approximates the OpenSCAD layout.

On Thu, Jun 11, 2020, at 3:57 PM, Wink Saville wrote:
I see an old post that someday there might be a GUI. I might have missed it, but seems that has been delayed, which is a "good thing" IMHO as editors are very personal.

What I'd like is something like what OpenSCAD does. So is there support for external editors where the "preview" window listens for file changes and updates the display?



--
You received this message because you are subscribed to the Google Groups "Curv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to curv+unsubscribe@googlegroups.com.

Wink Saville

unread,
Jun 11, 2020, 4:42:29 PM6/11/20
to Curv
Whoops I see it now:

$ curv --help | grep editor
   -e : Open editor window. $CURV_EDITOR overrides default editor.

Wink Saville

unread,
Jun 11, 2020, 5:14:56 PM6/11/20
to Curv
Bummer, setting CURV_EDITOR to `vim` or `code` (visual studio code) didn't work when using `curv -le xxx.curv`.

Vim didn't work because vim captures stdout, for some reason so the debug/status info that curv writes to stdout shows up in the editor window. And `code` didn't work because it runs in the background so it disconnects from the terminal, which causes curv to terminate.

The solution was actually easy, if you run `curv -l xxx.curv` (i.e. just "live" not "live editor") in one terminal and then run vim/code in another (or start it from a GUI and navigate to the xxx.curv file) then things seem to work as expected.

Doug Moen

unread,
Jun 11, 2020, 5:43:38 PM6/11/20
to Curv
Okay, I updated the README with details on how to use CURV_EDITOR.

For vim, you need to use CURV_EDITOR="gvim -f".
Note that "gvim" opens a window and "-f" means run in foreground.
I do not know the magic incantation for visual studio code.

I also added more prominent documentation for the '-O jit' flag.
If you rebuild the curv command, it will now warn you if you aren't using '-O jit'.

Doug Moen.

Wink Saville

unread,
Jun 11, 2020, 6:39:22 PM6/11/20
to Curv
Nice, looks and continues to work great :) I've updated my fork, nice you've opened source this, THANKS!
Reply all
Reply to author
Forward
0 new messages