Is it possible in Notepad ++ to associate a file extension with a dot in it?

I am really trying to link different types of files .erb. I would like to be able to communicate .css.erband .scss.erbwith CSS, .html.erbHTML and .js.erbwith JavaScript. Linking all files .erbto HTML is great for HTML files, but it doesn't work very well for JavaScript, CSS, or SCSS.

I tried putting css.erbetc. in the "User ext .:" field in the "Style Configurator" dialog box, but it doesn't seem to pick the files correctly.

I am skeptical that this is possible, because I think that the engine matches the last .to the end of the file name, and not, for example, something like filename.endswith(ext), but I thought it was worth asking, I found a way to make it work.

Any thoughts?

+4
source share
2 answers

CSS and decryption of ERB file extensions Use the following process:

  • Open a new file
  • Enter desired content
  • Use File=>Saveto save it as your desired MIME type, e.g. foo.cssfor CSS
  • Use File=>Save Asto save it again as your desired ERB file extension e.g.foo.css.erb

stylers.xml , Notepadd ++:

<LexerType ext="css.erb" desc="CSS" name="css">

<WordsStyle name="DEFAULT" fontSize="" fontStyle="0" fontName="" bgColor="FFFFFF" fgColor="000000" styleID="0"/>

<WordsStyle name="TAG" fontSize="" fontStyle="0" fontName="Batang" bgColor="FFFFFF" fgColor="0000FF" styleID="1"/>

<WordsStyle name="CLASS" fontSize="" fontStyle="0" fontName="" bgColor="FFFFFF" fgColor="FF0000" styleID="2"/>

<WordsStyle name="PSEUDOCLASS" fontSize="" fontStyle="1" fontName="" bgColor="FFFFFF" fgColor="FF8000" styleID="3"/>

<WordsStyle name="UNKNOWN_PSEUDOCLASS" fontSize="" fontStyle="0" fontName="" bgColor="FFFFFF" fgColor="FF8080" styleID="4"/>

<WordsStyle name="OPERATOR" fontSize="" fontStyle="1" fontName="" bgColor="FFFFFF" fgColor="000000" styleID="5"/>

<WordsStyle name="IDENTIFIER" fontSize="" fontStyle="1" fontName="" bgColor="FFFFFF" fgColor="8080C0" styleID="6" keywordClass="instre1"/>

<WordsStyle name="UNKNOWN_IDENTIFIER" fontSize="" fontStyle="0" fontName="" bgColor="FFFFFF" fgColor="000000" styleID="7"/>

<WordsStyle name="VALUE" fontSize="" fontStyle="1" fontName="" bgColor="FFFFFF" fgColor="000000" styleID="8"/>

<WordsStyle name="COMMENT" fontSize="" fontStyle="0" fontName="" bgColor="FFFFFF" fgColor="008000" styleID="9"/>

<WordsStyle name="ID" fontSize="" fontStyle="1" fontName="" bgColor="FFFFFF" fgColor="0080FF" styleID="10"/>

<WordsStyle name="IMPORTANT" fontSize="" fontStyle="1" fontName="" bgColor="FFFFFF" fgColor="FF0000" styleID="11"/>

<WordsStyle name="DIRECTIVE" fontSize="" fontStyle="0" fontName="" bgColor="FFFFFF" fgColor="0080FF" styleID="12"/>

</LexerType>

erb, stylers.model.xml .

+1

"" > " "...

  • ":" HTML.
  • : ext User ext. "erb" User ext.
  • " "
-1

All Articles