diff options
| author | Hugo <hugo@whynothugo.nl> | 2023-10-20 13:03:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-20 20:03:50 +0900 |
| commit | 1bfefd1f98dae54576a54b59b42379b275a00414 (patch) | |
| tree | 6a7cd5fc9a00160e04898153349004cca645aebe /README.md | |
| parent | Update parsers: sql, wing (diff) | |
| download | nvim-treesitter-1bfefd1f98dae54576a54b59b42379b275a00414.tar nvim-treesitter-1bfefd1f98dae54576a54b59b42379b275a00414.tar.gz nvim-treesitter-1bfefd1f98dae54576a54b59b42379b275a00414.tar.bz2 nvim-treesitter-1bfefd1f98dae54576a54b59b42379b275a00414.tar.lz nvim-treesitter-1bfefd1f98dae54576a54b59b42379b275a00414.tar.xz nvim-treesitter-1bfefd1f98dae54576a54b59b42379b275a00414.tar.zst nvim-treesitter-1bfefd1f98dae54576a54b59b42379b275a00414.zip | |
docs: add hint on configuring custom filetypes (#5552)
I thought that this functionality was not possible but there's actually
an API for it. This seems like a useful place for others to find more
information on it.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -745,3 +745,15 @@ require'nvim-treesitter.configs'.setup { -- } ``` + +#### Using an existing parser for another filetype + +For example, to use the `bash` tree-sitter to highlight file with +`filetype=apkbuild`, use: + +```lua +vim.treesitter.language.register("bash", "apkbuild") +``` + +The `bash` tree-sitter must be installed following the usual procedure [as +described above](#language-parsers). |
