今私は拡張子の.catを持つすべてのファイルの構文の強調表示を適用するのが好き。
これまでのところ、私はこれを行っている:
まず私は、ファイルタイプの拡張子の設定ファイルを作成しました:これの内容は、次のようになります~/.config/geany/filetype_extensions.conf
を:
[Extensions]
Gnuplot=*.gp;*.gnu;*.plt;
Galfit=*.gal;
Phosim=*.cat;
[Groups]
Script=Gnuplot;Galfit;Phosim;
、私はプログラムにカスタムのハイライトを適用しようとしていますGnuplot、Galfit、およびPhosim。 GnuplotとGalfitではうまく動作します。しかし、フォシムにはいくつかの問題があります。
それから私は、ファイル定義の設定ファイル作成:~/.config/geany/filedefs/filetypes.Phosim.conf
次のようになりますその内容:私はシンタックスハイライトを持っ
# example.cat
angle 30
Angle_RA 20.0
object none
# Till now,
# Words highlighted : angle 30 object none
# Words not highlighted: Angle_RA 20.0
# I like them also to be highlighted!
:
# Author : Bhishan Poudel
# Date : May 24, 2016
# Version : 1.0
[styling]
# Edit these in the colorscheme .conf file instead
default=default
comment=comment_line
function=keyword_1
variable=string_1,bold
label=label
userdefined=string_2
number=number_2
[keywords]
# all items must be in one line separated by space
variables=object Unrefracted_RA_deg SIM_SEED none
functions=
lables=10
userdefined=angle 30 Angle_RA 20.0 none
numbers=0 1 2 3 4 5 6 7 8 9
[lexer_properties]
nsis.uservars=1
nsis.ignorecase=1
[settings]
# default extension used when saving files
extension=cat
# single comments, like # in this file
comment_single=#
# multiline comments
#comment_open=
#comment_close=
# 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=
# lexer filetype should be an existing lexer that does not use lexer_filetype itself
lexer_filetype=NSIS
[build-menu]
EX_00_LB=Execute
EX_00_CM=
EX_00_WD=
FT_00_LB=
FT_00_CM=
FT_00_WD=
FT_02_LB=
FT_02_CM=
FT_02_WD=
が今私のexample.catはこのようになりますただ2つの言葉、すなわち、オブジェクトとなし。 私はそれが大文字を持つためのFortranに等しいスタイリングしようとしたが、それもうまくいきませんでした。
はどのように我々は、大文字、小文字が含まれている変数名の構文ハイライトを取得し、アンダースコアができますか?例えば
:object
none
:
私は言葉の構文ハイライトを得ました。
しかし、言葉の構文ハイライトを取得できませんでした:Angle_RA
20.0
また、私の私の数字は0
、1
は、.. 9
が強調表示されますが、小数が強調表示されません。小数点をどのように強調することができますか?例えば
:
Iまし言葉の構文ハイライト:1
1000
しかし、言葉の構文ハイライトを取得できませんでした:180.0
いくつかの便利なリンク49552.3
は、以下の通りである:
Make Geany recognize additional file extensions
Custom syntax highlighting in Geany
http://www.geany.org/manual/current/index.html#custom-filetypes 代わりに、クレアチンのhttp://www.geany.org/manual/#lexer-filetype