gboere / tree-sitter-fountain

Fountain grammar for tree-sitter.
MIT License
0 stars 2 forks source link

tree-sitter-fountain

CI discord matrix

A (rudimentary) tree-sitter parser for .fountain files.

Installation

You're probably already using nvim-treesitter. Open the file where you put its configs:

require'nvim-treesitter.configs'.setup {
    -- ...
}

-- Add the following:
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
treesitter_parser_config.fountain = {
    install_info = {
        url = "https://github.com/gboere/tree-sitter-fountain",
        files = {"src/parser.c"},
        branch = "master",
    },
    filetype = "fountain",
}
vim.filetype.add ({
    extension = {
        fountain = 'fountain'
    }
})

After doing that, you'll need to download queries/highlights.scm from the repo and put it into (NeoVim config folder)/after/queries/fountain/highlights.scm. Or some other runtime folder as (folder)/queries/highlights.scm. See :help rtp for a list of all possible folders.

Then, run :TSInstall fountain.

Updating

You'll need to fetch queries/highlights.scm manually. Then run :TSUpdate fountain.

References