[OpenSCAD] Abbreviations

maurizio butti maurizio.butti at gmail.com
Wed Jun 8 04:18:08 EDT 2016


I often use the Scite editor, based on the same Scintilla component as
OpenSCAD. As such I am really missing a very good Scite feature:
abbreviations. I implemented (in a rather crude way) abbreviation expansion
for common OpenSCAD constructs. This should allow for really fast coding.
As a bonus I added folding toggle as a keyboard shortcut (CTRL+*, also
added to the edit menu as "Toggle current fold").

*How this works:
Type a single character abbreviation in the editor, for example "c". Then
hit CTRL+B. The typed character has been replaced by "cube([]);". The
cursor is now positioned after the open square bracket for you to enter the
cube's dimensions.

*Full list of abreviations (the | character is not included but shows where
the caret will be positioned):
c cube([|]);
d difference() {\n\t|\n}
f for (i=[|]) {\n\t\n}
i intersection() {\n\t|\n}
m module |() {\n\t\n}
r rotate([|]);
s sphere(r=|);
t translate([|])
u union() {\n\t|\n}
x ,center=true|
y cylinder(r=|,h=);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20160608/5e63a776/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: editor-improvement.patch
Type: application/octet-stream
Size: 2929 bytes
Desc: not available
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20160608/5e63a776/attachment.patch>


More information about the Discuss mailing list