Syntax highlighting complex filename extensions

Syntax highlighting complex filename extensions

2
NewbieNewbie
2

    Aug 06, 2004#1

    Is it possible to uniquely identify a file extensions like filename.c.txt from other files whose extension might be filename.txt for the purpose of using different syntax highlighting ?

    6,683583
    Grand MasterGrand Master
    6,683583

      Aug 06, 2004#2

      No, definitively not.

      The file extension is defined by Microsoft as the characters AFTER the last dot. All characters BEFORE the last dot are part of the file name. The dot itself does not belong to the file extension nor the file name. It is the delimiter. File name + dot + file extension build the name of a file. That feature you want could only be used, if UE would accept wildcards for syntax highlighting, for example *.c.txt, instead of only using the file extension.

      But you can switch the syntax highlighting used for the current file manually by selecting the one you want from the menu View - View As (Highlighting File Type).

      But this is not stored and must be set manually for each file and every time UE is started again.
      Best regards from an UC/UE/UES for Windows user from Austria

      38
      Basic UserBasic User
      38

        Aug 07, 2004#3

        As a to followup on Mofi's answer, you could create various Key Mappings for different Language syntaxes to more quickly convert to them. For instance, I have a number of .TXT files that predominently contain SQL examples, and I've mapped Alt-Q to switch to View As... SQL (Language 13 for me), so after I've opened the file I can quickly display it to show SQL syntax highlighting.

        Just a thought.

        Dan
        Daniel Kirkdorffer
        http://www.kirkdorffer.com/

        2
        NewbieNewbie
        2

          Aug 09, 2004#4

          Many thanks for the clarification and ideas. I will manually choose highlighting theme thru the | view as... | menu.

          Regards ...

          6
          NewbieNewbie
          6

            Associate a more complex extension ?

            Jun 09, 2006#5

            Hello,

            I'm using files that are using ".css.dtml" as extensions (it is css files) and I'd like to associate it with the CSS syntax highlighting. Of course I cannot use only ".dtml" because other files are using it.

            I tried to simply add "CSS.DTML" on my wordfile but it does not work.

            Is it possible to do this ?

            Sebastien.

            6,683583
            Grand MasterGrand Master
            6,683583

              Re: Associate a more complex extension ?

              Jun 10, 2006#6

              Sorry, but this is not possible. The file extension is according to the specification from Microsoft only the part after last point. For example a file named "file.css.dtml" has the file name "file.css" and the extension "dtml". I personally avoid more than 1 point in the name of the file. I always use an underscore as word "delimiter" in a file name.

              From help of UE about syntax highlighting:

              File Extensions/Types

              Syntax Highlighting is determined either by the name of the file or its extension. More commonly the extension is used and to specify the extensions for which this language is applicable the following string should be used: "File Extensions = " and each extension is separated by a space.

              To specify that a filename is to be used to determine the language the following string should be used: "File Names = " and each name is separated by a space.

              So you can also use File Names = if you do not have too much CSS files with the wrong extension. But it is not possible to specify "File Extensions = " and "File Names = " for the same language definition. You have to copy the whole CSS language definition block and insert it before the language definition for files with the extension CSS and DTML. Example:

              /L3"CSS.DTML" File Names = ....

              /L4"DTML" File Extensions = DTML

              /L5"CSS" File Extensions = CSS

              And you cannot use wildcards in the File Names = specification!
              Best regards from an UC/UE/UES for Windows user from Austria

              6
              NewbieNewbie
              6

                Re: Associate a more complex extension ?

                Jun 10, 2006#7

                Well, because I have quite a lot of different files like this (due to the system we have to keep the "double" extension), I will keep choosing the colorization manually : that's not too difficult :)

                Thanks for your answer : I'll look at deeper the documentation next time.

                Sebastien