oni icon indicating copy to clipboard operation
oni copied to clipboard

Question: how to add Textmate bundles?

Open bfulop opened this issue 8 years ago β€’ 4 comments

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.

bfulop avatar Apr 04 '18 06:04 bfulop

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.

oni-bot avatar Apr 04 '18 06:04 oni-bot

@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.

badosu avatar Apr 04 '18 12:04 badosu

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.

bfulop avatar Apr 04 '18 18:04 bfulop

@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.

bfulop avatar Apr 12 '18 18:04 bfulop