admin管理员组

文章数量:1355522

This is really annoying...it really is messing up my syntax highlighting... I think it suddenly happened after I deleted one of my javascript_include_tag statements and saved...suddenly the highlighting changed.

This all happened around the time I created my first js.erb file...

Oh yeah: It was working before!!! I have "erb" already added as a file association/extension to html files...but for some reason, html.erb files are suddenly getting interpreted as javascript files! like, in the bottom left, it says what type of file you are viewing, and when I have an html.erb file open it says "javascript file" which is absurd...it used to say html erb...

This is really annoying...it really is messing up my syntax highlighting... I think it suddenly happened after I deleted one of my javascript_include_tag statements and saved...suddenly the highlighting changed.

This all happened around the time I created my first js.erb file...

Oh yeah: It was working before!!! I have "erb" already added as a file association/extension to html files...but for some reason, html.erb files are suddenly getting interpreted as javascript files! like, in the bottom left, it says what type of file you are viewing, and when I have an html.erb file open it says "javascript file" which is absurd...it used to say html erb...

Share Improve this question edited Jul 25, 2011 at 2:48 dmonopoly asked Nov 18, 2010 at 1:48 dmonopolydmonopoly 3,3315 gold badges36 silver badges53 bronze badges 1
  • Or Visual Web Developer from Microsoft, it's free as long as you register. Great editor. – Blake Commented Nov 18, 2010 at 1:58
Add a ment  | 

3 Answers 3

Reset to default 8

You can configure Notepad++ to recognize an .erb (.html.erb or .js.erb) file and associate it with a given language (html).

  1. In the menu bar, go to Settings > Style Configurator...
  2. In the list labelled "Language:", scroll down to HTML. Click on it
  3. Beneath the lists for Language and Style, there should appear two fields: Default ext and User ext. Enter 'erb' in the User ext field.
  4. Click Save & Close

Now when you open a file with the .erb extension (incl. .js.erb), Notepad++ will automatically apply syntax highlighting for HTML.

I figured out the problem myself. Since Rails 3 uses this new js.erb file, at one point, I went to the style configurator and added "erb" as an extension option under "Javascript." I had already done this for html so html.erb is recognized as html, so apparently notepad++ has this bug in it b/c once I added "erb" to Javascript all html.erb began getting recognized as JS files. Removing that "erb" to Javascript in the style configurator fixed the problem. :)

Check the post here:

  • http://www.thekua./atwork/2009/07/file-associations-in-notepad/

It allows you to change the associations.

本文标签: