aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/treesitter.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/treesitter.txt')
-rw-r--r--runtime/doc/treesitter.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index dfaff672e6..cef48e207f 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -24,7 +24,7 @@ via a plugin like https://github.com/nvim-treesitter/nvim-treesitter.
Parsers are searched for as `parser/{lang}.*` in any 'runtimepath' directory.
If multiple parsers for the same language are found, the first one is used.
(This typically implies the priority "user config > plugins > bundled".
-A parser can also be loaded manually using a full path: >
+A parser can also be loaded manually using a full path: >lua
vim.treesitter.require_language("python", "/path/to/python.so")
<
@@ -37,7 +37,7 @@ file), multiple parsers may be needed to parse the full buffer. These are
combined in a |LanguageTree| object.
To create a LanguageTree (parser object) for a buffer and a given language,
-use >
+use >lua
tsparser = vim.treesitter.get_parser(bufnr, lang)
<
@@ -46,7 +46,7 @@ Currently, the parser will be retained for the lifetime of a buffer but this
is subject to change. A plugin should keep a reference to the parser object as
long as it wants incremental updates.
-Whenever you need to access the current syntax tree, parse the buffer: >
+Whenever you need to access the current syntax tree, parse the buffer: >lua
tstree = tsparser:parse()
<
@@ -366,10 +366,10 @@ queries that make them available.
As an additional rule, capture highlights can always be specialized by
language, by appending the language name after an additional dot. For
-instance, to highlight comments differently per language: >
+instance, to highlight comments differently per language: >vim
hi @comment.c guifg=Blue
- hi @comment.lua @guifg=DarkBlue
+ hi @comment.lua guifg=DarkBlue
hi link @comment.doc.java String
<
The following captures are linked by default to standard |group-name|s: