Sounak
Sounak

Reputation: 4968

How to set syntax highlighting in sublime text through editorconfig

my .editorconfig file look like this

root = true

[*.rush]
syntax = ruby

I have put it in the top of the folder hierarchy. However, the sublime text shows all the .rush files as plain text and I have to manually change the syntax highlight to Ruby.

Anyone knows how to do this?

Upvotes: 1

Views: 382

Answers (2)

Andrew
Andrew

Reputation: 3969

It makes sense to be able to specify the syntax in the .editorconfig file.

Alternatively, it could be a new standard that editors or programs can look at for specifying the syntax of different globs, file names, or file extensions.

[$]> cat ~/.syntaxconfig

[$]> cat ~/.syntaxmapping

[.custom_shell] bash
[{*.rush, *.wish}] ruby
bash [.custom_shell]
ruby [{*.rush, *.wish}]
[bash]
.custom_shell

[ruby]
*.rush
*.wish

Upvotes: 0

dgarg
dgarg

Reputation: 76

Syntax highlighting isn't supported by EditorConfig yet.

The core set of supported properties that is widely supported by all editors -

  • indent_style
  • indent_size
  • tab_width
  • end_of_line
  • charset
  • trim_trailing_whitespace
  • insert_final_newline
  • root

max_line_length is supported by a limited number of editors (Emacs, Vim, Atom, ReSharper, Rider, AppCode, IntelliJ IDEA, PhpStorm, PyCharm, RubyMine, and WebStorm)

It's still an open issue (#190) to support highlighting.

You can find other proposed properties on its GitHub wiki.

Upvotes: 2

Related Questions