Portál AbcLinuxu, 14. července 2025 06:17


Dotaz: mcedit syntax highlighting HOWTO

21.1.2008 21:42 j3nda | skóre: 14 | ostrava/brno
mcedit syntax highlighting HOWTO
Přečteno: 1188×
Odpovědět | Admin
zdravim,

najde se nekdo, kdo by me odkazal na nejaky zdroj, kde si nastuduju, jak bych mel napsat syntax?

rad bych si doplnil soubor se syntaxi do mcedit (pro muj vlastni format souboru).

jedna se mi o to, zda je nekde souhrnny popis s vysvetlenim vcetne spravne syntaxe pro

/usr/share/mc/syntax/*.syntax

vim, ze si muzu poctive projit jiz vytvorene a tak nejak odvodit k cemu to slouzi. ale chci to napsat rychle a nechci moc laborovat - radejc to nastuduju a potom napisu.

takze najde se nekdo ochotny me odkazat na nejake dobre zdroje?

ps. chvili sem googlil, prochazel maillisty a nic kloudneho nenasel.
___---==~[ uxunilcba | baclniuxu ]~==---__sevrer_pnly_liunx-lkie_hcaricku__/libGDX-rulez-the-W0R7D!___
Nástroje: Začni sledovat (1) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

21.1.2008 21:46 j3nda | skóre: 14 | ostrava/brno
Rozbalit Rozbalit vše Re: mcedit syntax highlighting HOWTO
Odpovědět | | Sbalit | Link | Blokovat | Admin
:-/ jsem to ale vul: http://gd.tuwien.ac.at/.vhost/www.linuxcommand.org/man_pages/mcedit1.html

SYNTAX HIGHLIGHTING mcedit supports syntax highlighting. This means that keywords and con- texts (like C comments, string constants, etc) are highlighted in dif- ferent colors. The following section explains the format of the file ~/.mc/cedit/Syntax. If this file is missing, system-wide /usr/share/mc/syntax/Syntax is used. The file ~/.mc/cedit/Syntax is rescanned on opening of a any new editor file. The file contains rules for highlighting, each of which is given on a separate line, and define which keywords will be highlighted to what color. ...

- - - pokud bu to mel nekdo nekce v CZ (prip. link na CZ) rad si to prectu v rodnem jazyce ;-)
___---==~[ uxunilcba | baclniuxu ]~==---__sevrer_pnly_liunx-lkie_hcaricku__/libGDX-rulez-the-W0R7D!___
21.1.2008 21:56 j3nda | skóre: 14 | ostrava/brno
Rozbalit Rozbalit vše Re: mcedit syntax highlighting HOWTO
Odpovědět | | Sbalit | Link | Blokovat | Admin
snad to nekomu jeste pomuze, takovy strucny vyklad:

syntax hightlight howto http://gd.tuwien.ac.at/.vhost/www.linuxcommand.org/man_pages/mcedit1.html
~/.mc/cedit/Syntax
    ===
    If this file is missing, system-wide /usr/share/mc/syntax/Syntax
    The  file command has three arguments.
    The first argument is a regular expression that is applied to the file name
      to determine if the following section applies to the file.
    The second argument is the description of the file type. It is used in cooledit;
      future  versions  of mcedit  may  use  it as well.
    The third optional argument is a regular expression to match the first line
      of text of the file.  The  rules  in the  following  section apply if
      either the file name or the first line of text matches.

soubor se syntaxi pro zvyrazneni
    ===
       # default colors
       define  comment   brown
       context default
         keyword  whole  if       yellow
         keyword  whole  else     yellow
         keyword  whole  for      yellow
         keyword  whole  while    yellow
         keyword  whole  do       yellow
         keyword  whole  switch   yellow
         keyword  whole  case     yellow
         keyword  whole  static   yellow
         keyword  whole  extern   yellow
         keyword         {        brightcyan
         keyword         }        brightcyan
         keyword         ?*?      green

       # C comments
       context /\* \*/ comment

       # C preprocessor directives
       context linestart # \n red
         keyword  \\\n  brightred

       # C string constants
       context " " green
         keyword  %d    brightgreen
         keyword  %s    brightgreen
         keyword  %c    brightgreen
         keyword  \\"   brightgreen

    - - -
    context [exclusive] [whole|wholeright|wholeleft] [linestart] delim [linestart] delim [foreground] [background]
    context default [foreground] [background]
    wholechars [left|right] characters
    keyword [whole|wholeright|wholeleft] [linestart] string foreground [background]

    \t = tab(s)
    \s = space(s)
    \n = new-line
    \\ = backslash
    *  = wildcard
___---==~[ uxunilcba | baclniuxu ]~==---__sevrer_pnly_liunx-lkie_hcaricku__/libGDX-rulez-the-W0R7D!___
22.1.2008 12:19 Semo | skóre: 45 | blog: Semo
Rozbalit Rozbalit vše Re: mcedit syntax highlighting HOWTO
Odpovědět | | Sbalit | Link | Blokovat | Admin
man mcedit
If you hold a Unix shell up to your ear, you can you hear the C.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.