我有一个类似的问题;
我复制并编辑了filetype_extensions.conf
in my ~/.config/geany
adding:
CALIBRE=*.rul;*.svrf;*.SVRF;*.cal;
然后下~/.config/geany/filedefs
我创建了以下文件:
filetypes.CALIBRE.conf
==> 我的自定义文件类型
filetypes.commmon
==> 我想要特定颜色的命名样式
# For complete documentation of this file, please see Geany's main documentation
[styling]
comment=svrf_comment
key=svrf_keyword_comment,bold
[settings]
# default extension used when saving files
extension=svrf
lexer_filetype=NONE
[keywords]
# all items must be in one line
svrf=EXT ENC INT EXPAND
# the following characters are these which a "word" can contains, see documentation
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
# single comments, like / in this file
comment_single=//
# multiline comments
#comment_open=/*
#comment_close=*/
# set to false if a comment character/string should start at column 0 of a line, true uses any
# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
#command_example();
# setting to false would generate this
# command_example();
# This setting works only for single line comments
comment_use_indent=true
# context action command (please see Geany's main documentation for details)
context_action_cmd=
[indentation]
#width=4
# 0 is spaces, 1 is tabs, 2 is tab & spaces
#type=1
[build-menu]
# %f will be replaced by the complete filename
# %e will be replaced by the filename without extension
# (use only one of it at one time)
#FT_02_LB=_Lint
#FT_02_CM=jshint "%f"
#FT_02_WD=
#error_regex=([^:]+): line ([0-9]+), col ([0-9]+)
但是,当我打开 svrf 文件类型时,我的自定义文件类型无法识别(当我选择某些样式时没有特定颜色)。
如果我选择[styling=C]
and lexer_filetype=C
我正在获取“C”代码的颜色...
我也尝试过[styling]
and lexer_filtype=NONE
,但我的自定义突出显示再次未被识别。
我已经准备好 geany 手册,并查看了一些帖子,但没有一个完全回答这个主题(在第二个溢出链接上,用户已映射到现有文件类型,因此他没有得到他希望的行为)。
- geany 自定义文件类型 .sass 用于语法高亮 https://stackoverflow.com/questions/19095828/geany-custom-filetype-sass-for-syntax-highlighting/66387664#66387664
- Geany:某些单词的自定义文件类型的语法突出显示 https://stackoverflow.com/questions/37420503/geany-syntax-highlighting-for-custom-filetype-for-some-words?rq=1
您知道如何解决这个问题吗?