CadQuery / CQ-editor

CadQuery GUI editor based on PyQT
Apache License 2.0
757 stars 116 forks source link

vi mode using vim-spyder #424

Open roel-v opened 8 months ago

roel-v commented 8 months ago

I've been toying with ways to add vi-style editing support to the editor. To reduce duplication of work I've focused on re-using as much as possible from the vim-spyder plugin for Spyder. I've gotten a proof of concept mostly working, most of what remains is filling in boilerplate. Before I move ahead on this though I'd like to discuss how to go about it and whether it's worth investing my time (if there's no chance this will ever get merged anyway, I won't).

Getting this Spyder plugin to work with cq-editor is not difficult, the options revolve around the trade off between whether one wants to be able to use the plugin as-is, without any changes, which would require changes to the cq-editor internals; or a way that is less invasive but would require changes to the plugin, breaking compatibility, which is mostly an 'in the future' issue (and fwiw the last update to this plugin is from 6 months ago).

Roughly I see three paths:

I would appreciate feedback on this matter, even if negative so that I know if I should continue thinking about this. Thanks.

adam-urbanczyk commented 8 months ago

TBH I think this does not fit into the minimalistic scope of CQ-editor. Given that you can use any external editor including ([neo]vim), what is the reason to even consider this?

roel-v commented 8 months ago

OK fair enough. The reason for a vim mode is to move cq-editor more in the direction of a full-fledged IDE. I use Openscad's gui now in the way you say, with one editor window and the gui as a preview basically, but it's quite hacky. Cq-editor has more functionality for which you'd prefer to not switch between applications even less (like using the debugger). IMO having a proper IDE that does more than just integrate a bare-bones text editor, preview and debugger is needed to make cadquery a serious option for designing 3d parts. There's room between Fusion 360-style 'point and click' design and a fully code-focused approach where the IDE is an afterthought. But if the vision for cq-editor is to be a lightweight, bare-bones editor-with-debugger, then OK, I can take that into account.

adam-urbanczyk commented 8 months ago

You might want to consider developing a Spyder plugin for CQ/OCP. Then you'll get all the goodies of Spyder. It did cross my mind, but I will not work on this myself in the foreseeable future.

roel-v commented 8 months ago

Yes I looked at that, but that's not as straight forward as it looked at first, either. And I'm not keen on taking on a whole project to maintain by myself. But that would be the way to go for anyone wanting extended functionality.