0

I use Geany for Calculix Graphix and I set a custom file type up for syntax highlighting. This custom file type does not show syntax hightlighting (it shows these files as normal text file). In case it is relevant: I work with Xubuntu 22.04 and Geany 1.38.

Syntax of Calculix Graphix

On each line, a keyword with optional parameters and data (coordinates or entity names). Comment starts with #. Keyword and parameter are not case sensitive. File extension can be: *.fbd or *.fbl.

My custom files

Geany documentation states that custom filetypes should be done in and not in the installation directory.

filetypes.CalculixGraphix.conf

I created this file from Abaqus file type (which works) and moved to ~/.config/geany/filedefs. Below an extract

[styling]
default=default
comment=comment_line
number=number
string=string_1
operator=operator
processor=eltype
starcommand=keyword
argument=parameter

[keywords]
starcommand=anim area asgn bia mult div body break call capt cmap cntr col comp cont copy corrad csysa cut del dist div ds elem else if elty endif endwhile enq eprop exit fil flip flpc font frame gbod gonly graph grpa grps gsur gtol hcpy help int init lcmb length line lnor mata map mats max maxc maxr menu merg mesh mids min minc minr minus mm move movi msg mshp neigh node norm nurl nurs ori plot plus pnt prnt proj qadd qali qbia qbod qcnt qcut qdel qdis qdiv qenq qfil qflp qint qlin qmov qmsh qnor qpnt qnod qrem qseq qshp qspl qsur qtxt quit read rep rnam rot save scal send seqa seqc seql seta setc sete seti seto setr shpe split stack steps stop surf swep sys test thrs tra trfm txt typs ucut ulin val valu view volu while wpos wsize zap zoom

argument=tune steps time real model start on off alpha beta nadapt bg graph max maxr maxc minc mem free keep netgen tetgen thrds rbe mpc usr classic gray inferno jet coolwarm turbo viridis scal rot rad nor mir se0 pic mult div auto be2 be3 tr3 tr6 qu4 qu8 he8 he20 lock ulock be2r be2f be2d be3r be3f tr3u tr3e tr3s tr3c tr6u tr6e tr6s tr6c qu4e qu4c qu4r qu4er qu4sr qu4cr qu8e qu8s qu8c qu8r  qu8er qu8sr qu8cr he8f he8i he8r he20r pe6 pe6f pe15 pe15r te4 te4f te10 te10m te10t set rec cx cy cz equal jbir aspr mca amp mat nr descr BLEND gif png ps tga name eq ne surf volu x y z rx ry rz nolock fast tet block lonly nolength noangle angle force lin gen rem equ loops delay frames make clean abq ans nas con tie nsc v vs define compact control knot in par add ext nom new ext edg ndsb fbd stl ast dar frd gmp lst pat skv tcg bin dbin sta raw names spc slide trac pres film dflux force quadlin sur dolfyn duns isaac periodic foam cyclic cycmpc cycmpcf areampc gap afte befo nod pln cyl con tor sph abs pow float fill line edge n e p l c s b S L se sh d u f l0 t a ah eh o r g i h b k m w y x q

[settings]
extension=fbd

comment_single=#

comment_use_indent=false

context_action_cmd=

filetype_extensions.conf

I edited this file with:

[Extensions]
CalculixGraphix=*.fbd;*.fbl;

My example to check syntax highlighting

PNT a0       0.95000        0.1000        0.00000
LINE l0 a0 b0 101
LCMB C007  - l13 - l12
GSUR A001 - BLEND + C001 + C002 + C003 + C004
GBOD B014 NORM - A03P - A03K + A01B + A043 + A03Z - A03O
SETA UP p a2
plot p all b
read ../rae2822.fbd
del me
div bl 12
#div all div 2
swep s1 s2 tra 0 0 0.01 1 append
comp s1 do
elty all he8f
mesh all
send all abq
plot e all
view elem on

My research

My references are Geany documentation and this post.

I tried to manually force the detection of filtetype with Document > Define filetype without success.

These post1 and post2 mention a lexer. This is something I don't understand so I do not know if I need a lexer: I did not find any for Abaqus file type.

Please let me know what is needed to have the syntax highlighting working. Thank you.

Fabrice
  • 1
  • 2

0 Answers0