Oni: Question: how to add Textmate bundles?

Created on 4 Apr 2018  Â·  4Comments  Â·  Source: onivim/oni

Hello,

I was trying to add a Textmate language grammar definition file for Twig to get syntax highlighting. Twig is templating language for HTML/PHP.

Here are the steps I went through:

  1. Convert the language bundle from the Textmate repo as described in the Atom docs
  2. Convert CSON to JSON
  3. Added this line to my config.tsx:
...
"ui.fontSize": "12px",
"language.twig.textMateGrammar": "[absolute path on my HD to]/twig/grammars/html (twig).json"
  1. Restarted Oni as good mesure 😊

Is there anything I'm missing (the syntax highlighting still doesn't work...)? Once I get the correct workflow sorted out, I can reformat this question to serve as a reference for others.

bug insider

Most helpful comment

@bfulop You can also try the vim syntax highlight if you have issues sorting this out (https://github.com/lumiliet/vim-twig).

In the future Oni will provide a mechanism to fetch vim plugins builtin, for the moment you can check the Configuration wiki page on how set your init.vim and use a plugin loader like NeoBundle.

All 4 comments

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

@bfulop You can also try the vim syntax highlight if you have issues sorting this out (https://github.com/lumiliet/vim-twig).

In the future Oni will provide a mechanism to fetch vim plugins builtin, for the moment you can check the Configuration wiki page on how set your init.vim and use a plugin loader like NeoBundle.

Thanks @badosu, it worked great!

And installing was even easier: you just need to copy the plugin files (as described in the wiki – installing a vim plugin). The only difference is, that I think from v 0.3.2, the .oni location is no longer in $HOME/.oni/plugins as the Wiki says, but in $HOME/.config/oni/plugins, at least on the Mac.

@badosu you were right to suggest using the vim plugin–in general they contain more than just syntax highlighting but usually other extra features that helps vim understand that language e.g. folding, snippets.

In the future I will always first start with the vim plugin.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jordwalke picture jordwalke  Â·  20Comments

rektrex picture rektrex  Â·  18Comments

phaazon picture phaazon  Â·  21Comments

badosu picture badosu  Â·  20Comments

MikaAK picture MikaAK  Â·  20Comments