如何在Geany IDE

时间:2016-01-13 11:56:35

标签: code-snippets geany code-folding genie

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

  • 如何在Geany中为Genie编程语言进行代码折叠?

  • 有没有人有片段分享?

1 个答案:

答案 0 :(得分:2)

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

~/.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

我只是一个学习者,所以可以随心所欲地改变它。