Creating your own syntax highlighting in GEdit?

后端 未结 2 1108
深忆病人
深忆病人 2020-12-02 17:11

How do you add a \'keyword\' to the GEdit list of keywords? I basiclly want to make the printf function look like a keyword.

printf(\"Hello World\\n\");
         


        
2条回答
  •  北海茫月
    2020-12-02 18:07

    GEdit uses GtkSourceView for its syntax highlighting. You should be able to find the c.lang file it uses to highlight C code by typing a command like this:

    $ locate gtksourceview | grep /c.lang
    

    Once you find the lang file, open it up in a text editor (it's an XML file) and near the bottom you'll see a list of keywords which you should be able to add printf to.

提交回复
热议问题