textmatebundles - textmate bundles not recognizing differences -


So I am trying to create a set of grammar that correctly identifies different file extensions.

Files with Templates (JS / CSS / HTML) End This is similar to how ruby ​​does with js.erb, css.erb, etc. So I modified the file type attribute to js.template css.template and templates for html itself. But this does not seem to work, they are only default in templates, although they are more specific.

But for some reason I do not want to recognize my other file extensions. Any idea why this is happening or why Ruby Grammar seems to work, but not mine?

The detailed answer depends on the scope and therefore the syntax on the desired highlighting. The general approach is as follows:

  1. Open the Bundle Editor (Control-Meta-Command-B)
  2. Find the definition of JavaScript language, i.e. in the JavaScript bundle called "javascript" There is a grammar definition
  3. Open it and look for the line beginning with "Filetype", which is the fileTypes = ('js', 'htc', 'jsx');
  4. Add your file ending, i.e. "js.template"
  5. Close the bundle editor or activate another snippet / command / grammar or click on the test button Please reload the grammar (note that the manual language definition is preferred to eliminate the file, so create a new file with that extension and load it with the systemmat to ensure it)
  6. < Li> Definition of any grammar Repeat the test that you want to work with the end of another file, ie HTML and CSS

Such default in your files. However, Ruby increases the grammar slightly on the rail bundle, so you can also increase the supported file types of these grammars.


Comments