如何在 Geany IDE 中为 Genie(.gs 文件)进行代码折叠

How to have code folding for Genie (.gs files) in Geany IDE

Geany 似乎不能很好地处理 Genie 编程语言中的代码。它不提供代码折叠或特定片段。

为了获得代码折叠打开(或创建)文件:

~/.config/geany/filedefs/filetypes.Genie.config

并将 [lexer_properties] 部分添加或编辑为:

[settings]
# Vala uses the C lexer
lexer_filetype=Python
tag_parser=Python

对于代码片段,这里是基于 Genie 教程的代码片段。只需将菜单导航到工具>配置文件>snippets.conf 并添加以下内容即可添加它们:

[Genie]
if=if %cursor%a > 0\n\t%cursor%
ifdo=if %cursor%a > 0 do %cursor%
else=else if %cursor% is %cursor%\n\t%cursor%
for=for var %cursor%i = 1 to 10\n\t
fordo=for %cursor%s in %cursor%args do %cursor%print s
whiledo=while %cursor% do %cursor%
while=while %cursor%\n\t%cursor%
do=%cursor%count:int = 1\ndo\n\t%cursor%print "%i", count\n\tcount++\nwhile %cursor%count <= 10
case=case %cursor%a\n\twhen %cursor%0,1,2\n\t\t%cursor%print "a is less than 3"\n\twhen %cursor%3 \n\t\t%cursor%print "a is 3"\n\tdefault\n\t\t%cursor%print "a is greater then 3"
try=try%block%\ncatch (%cursor%)%block_cursor%
def=def %cursor%(%cursor%a:%cursor%string):%cursor%Type\n\t%cursor%
class=class %cursor%Foo:%cursor%Object\n\t%cursor%i:int\n\t%cursor%init\n\t\t%cursor%print "something"\n\tfinal\n\t\t%cursor%print "finalizing"\n\tconstruct( %cursor%:%cursor% )\n\t\t%cursor%a=b
array=%cursor%tokens : array of string = {%cursor%"This", "Is", "Genie"}
list=var %cursor%l = new list of string\n%cursor%l.add()
dictstrg=var %cursor%d = new dict of string,string
dictint=var %cursor%d = new dict of string,int
try=try\n\t%cursor%fn("home/jamie/test")\nexcept %cursor%ex : %cursor%IOError\n\t%cursor%print "Error: %s", ex.message

我只是一个学习者,请随意更改。