add ruby slim-lang syntax support · Issue #1693 · sharkdp/bat (original) (raw)

Here is some info on how I got slim syntax working in bat, which may help if someone wants to bring support into bat.

The project at https://github.com/slim-template/ruby-slim.tmbundle appears to only contains a .tmLanguage file, which bat does not seem to support.

But I was able to still get slim syntax highlighting working inside bat by first converting the .tmLanguage file into a .sublime-syntax file by using the following tool: https://github.com/aziz/SublimeSyntaxConvertor

Here are the step I used:

git clone https://github.com/slim-template/ruby-slim.tmbundle

gem install sublime_syntax_convertor

sublime_syntax_convertor ruby-slim.tmbundle/Syntaxes/Ruby\ Slim.tmLanguage

Now copy the resulting .sublime-syntax file to your bat config syntaxes dir and run bat cache --build

The result is working well for me!