2016-08-18 2 views
0

По умолчанию * .bib-файлы предполагают подсветку синтаксиса латексных файлов в geany. Однако я хотел изменить подсветку синтаксиса .bib-файлов.Geany: Выделенная подсветка синтаксиса для файлов bibtex (* .bib)

Я создал определение файла для BibTex:

~/.config/geany/filedefs/filetype.Bibtex.conf 

который выглядит следующим образом:

# Geany Color Syntax support for Gnuplot 4.2+ 
# version 0.1 
# April 5, 2013 


[styling] 
# Edit these in the colorscheme .conf file instead 
default=default 
comment=comment_line 
stringdq=string_1 
stringlq=string_2 
stringrq=string_2 
function=keyword_1 
variable=keyword_1,bold 
label=label 
userdefined=keyword_2,bold 
sectiondef=keyword_1 
subsectiondef=keyword_1 
ifdefinedef=keyword_1 
macrodef=keyword_1 
stringvar=string_1 
number=number_1 
sectiongroup=keyword_1 
pageex=keyword_1 
functiondef=keyword_1 
commentbox=comment 


[keywords] 
# all items must be in one line 
variables=abstract address annote author booktitle chapter contents copyright crossref doi edition editor institution isbn issn lccn journal key keywords month note number organization pages price publisher school series title type url language volume year 
userdefined=article book booklet conference inbook incollection manual masterthesis misc phdthesis proceedings techreport unpublished 


[lexer_properties] 
nsis.uservars=1 
nsis.ignorecase=1 


[settings] 
# default extension used when saving files 
extension=bib 

# 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=rm fit.log; galfit %e.gal; rm galfit.0*; open fit.log 
EX_00_WD= 
FT_00_LB= 
FT_00_CM= 
FT_00_WD= 
FT_02_LB= 
FT_02_CM= 
FT_02_WD= 

Затем я включил расширение файла в файле:

~/.config/geany/filetype_extensions.conf 

Теперь предположим, У меня есть пример файла bib, например bibtex3.bib, который выглядит следующим образом:

@article{einstein, 
    author =  "Albert Einstein", 
    title =  "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) 
       [{On} the electrodynamics of moving bodies]", 
    journal =  "Annalen der Physik", 
    volume =  "322", 
    number =  "10", 
    pages =  "891--921", 
    year =   "1905", 
    DOI =   "http://dx.doi.org/10.1002/andp.19053221004" 
} 

Но все-таки я не вижу подсветку синтаксиса в .bib файлов.

Некоторые ссылки по теме:
http://www.geany.org/manual/0.14/#filetype-extensions
Custom syntax highlighting in Geany
Make Geany recognize additional file extensions

Вопрос: Как к таможне подсветка синтаксиса .bib файлов в Geany?

ответ

0

По умолчанию .bib файлы связаны с Latex. Измените файл:

~/.config/geany/filetype_extensions.conf 

которые выглядят следующим образом:

# Filetype extension configuration file for Geany 
# Insert as many items as you want, separate them with a ";". 
# See Geany's main documentation for details. 
[Extensions] 
Abaqus=*.inp; 
Abc=*.abc;*.abp; 
ActionScript=*.as; 
Ada=*.adb;*.ads; 
Asciidoc=*.asciidoc;*.adoc; 
ASM=*.asm;*.asm51;*.a51; 
Batch=*.bat;*.cmd;*.nt; 
CAML=*.ml;*.mli; 
C=*.c;*.xpm; 
C++=*.cpp;*.cxx;*.c++;*.cc;*.h;*.hpp;*.hxx;*.h++;*.hh;*.C;*.H; 
Clojure=*.clj;*.cljs;*.cljc; 
CUDA=*.cu;*.cuh;*.h; 
C#=*.cs; 
CMake=CMakeLists.txt;*.cmake;*.ctest; 
COBOL=*.cob;*.cpy;*.cbl;*.cobol; 
CoffeeScript=*.coffee;Cakefile;*.Cakefile;*.coffee.erb;*.iced;*.iced.erb; 
Conf=*.conf;*.ini;config;*rc;*.cfg;*.desktop;*.properties; 
CSS=*.css; 
Cython=*.pyx;*.pxd;*.pxi; 
D=*.d;*.di; 
Diff=*.diff;*.patch;*.rej; 
Docbook=*.docbook; 
Erlang=*.erl;*.hrl; 
F77=*.f;*.for;*.ftn;*.f77;*.F;*.FOR;*.FTN;*.fpp;*.FPP; 
Ferite=*.fe; 
Forth=*.fs;*.fth; 
Fortran=*.f90;*.f95;*.f03;*.f08;*.F90;*.F95;*.F03;*.F08; 
FreeBasic=*.bas;*.bi;*.vbs; 
Genie=*.gs; 
GLSL=*.glsl;*.frag;*.vert; 
Go=*.go; 
Graphviz=*.gv;*.dot; 
Haskell=*.hs;*.lhs;*.hs-boot;*.lhs-boot; 
Haxe=*.hx; 
HTML=*.htm;*.html;*.shtml;*.hta;*.htd;*.htt;*.cfm;*.tpl; 
Java=*.java;*.jsp; 
Javascript=*.js; 
JSON=*.json; 
LaTeX=*.tex;*.sty;*.idx;*.ltx;*.latex;*.aux; 
Lisp=*.lisp; 
Lua=*.lua; 
Make=*.mak;*.mk;GNUmakefile;makefile;Makefile;makefile.*;Makefile.*;*.make; 
Markdown=*.mdml;*.markdown;*.md;*.mkd;*.mkdn;*.mdwn;*.mdown;*.mdtxt;*.mdtext; 
Matlab/Octave=*.m; 
NSIS=*.nsi;*.nsh; 
Objective-C=*.m;*.mm;*.h; 
Pascal=*.pas;*.pp;*.inc;*.dpr;*.dpk; 
Perl=*.pl;*.perl;*.pm;*.agi;*.pod; 
PHP=*.php;*.php3;*.php4;*.php5;*.phtml; 
Po=*.po;*.pot; 
Python=*.py;*.pyw;SConstruct;SConscript;wscript; 
PowerShell=*.ps1;*.psm1; 
reStructuredText=*.rest;*.reST;*.rst; 
R=*.R;*.r; 
Rust=*.rs; 
Ruby=*.rb;*.rhtml;*.ruby;*.gemspec;Gemfile;rakefile;Rakefile; 
Scala=*.scala;*.scl; 
Sh=*.sh;configure;configure.in;configure.in.in;configure.ac;*.ksh;*.mksh;*.zsh;*.ash;*.bash;.bashrc;bash.bashrc;.bash_*;bash_*;*.m4;PKGBUILD;*profile; 
SQL=*.sql; 
Tcl=*.tcl;*.tk;*.wish; 
Txt2tags=*.t2t; 
Vala=*.vala;*.vapi; 
Verilog=*.v; 
VHDL=*.vhd;*.vhdl; 
XML=*.xml;*.sgml;*.xsl;*.xslt;*.xsd;*.xhtml;*.xul;*.dtd;*.xtpl;*.mml;*.mathml; 
YAML=*.yaml;*.yml; 
Zephir=*.zep; 
None=*; 

# Note: restarting is required after editing groups 
[Groups] 
Programming=Clojure;CUDA;Cython;Genie;Scala; 
Script=Graphviz; 
Markup= 
Misc=JSON; 
None= 

Теперь сделайте следующие изменения:

LaTeX=*.tex;*.sty;*.idx;*.ltx;*.latex;*.aux; 

Затем новые определения файлов должны работать для BibTeX файлов.

Если это не помогло: открыть требуемый .bib-файл. Документ> SetFiletype> Язык сценариев> Исходный файл Bibtex.

Смежные вопросы