Menu

Can you alias file langauge types?

Per
2005-06-17
2012-11-13
  • Per

    Per - 2005-06-17

    ie, say you are opening file which are xml, but don't have the xml extention it would be nice if you could alias their extention so that Notepad++ would know that that is what they are?

    (I know you chose it manually each time from the drop down menu)

     
    • Eugene Wee

      Eugene Wee - 2005-06-17

      Yeah, this sort of capability would be good (if it exists and I learnt how to use it) - it would solve my "Emulating Python Language Styling" problem too (assuming it extended to entire filenames, sort of like how Makefile support seems to work).
      http://sourceforge.net/forum/forum.php?thread_id=1302921&forum_id=331754

       
    • Don HO

      Don HO - 2005-06-19

      The answer is in Styler Configurator :
      Choose your language tab then add your extension in "user ext" filed.

      Don

       
    • Eugene Wee

      Eugene Wee - 2005-06-20

      "Choose your language tab then add your extension in "user ext" filed."
      But in the case of SConstruct files, there is no file extension. I need files named "SConstruct", "Sconstruct" and "sconstruct" to be treated as python files.

      This is basically like what happens for makefiles. The default extension is given as "mak", but files named "Makefile" are recognised as makefiles.

       
      • Don HO

        Don HO - 2005-06-20

        > But in the case of SConstruct files, there is no file extension.
        > I need files named "SConstruct", "Sconstruct" and "sconstruct" to be treated as python files.

        In your case, there's no way to apply the syntax highlighter automatically since Notepad++ detect the file extension to recognize the language of type.

        > but files named "Makefile" are recognised as makefiles.

        It's hard coding for the case of makefile.

        Don

         
        • Nobody/Anonymous

          > In your case, there's no way to apply the syntax highlighter automatically since Notepad++ detect > the file extension to recognize the language of type. 
          > It's hard coding for the case of makefile.

          I'm having the same problem with shell/perl scripts : some have a .*sh or .pl extension but many of them don't.
          All these scripts named without extension have a header like "#!/bin/ksh" or "#!C:\perl\bin\perl.exe" for example.
          Header-based detection, like in NEdit for example, could be an interesting feature !

           
    • Per

      Per - 2005-07-12

      Thanks Don, that works for me.

      (And sorry about the wording of the original message, I seem to have forgotten half the words - must have been really tired then!)