mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
feat(docs): "yxx" runs Lua/Vimscript code examples #31904
`yxx` in Normal mode over a Lua or Vimscript code block section will execute the code. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -959,7 +959,7 @@ do
|
||||
--- function vim.startswith(s, prefix)
|
||||
--- vim.validate('s', s, 'string')
|
||||
--- vim.validate('prefix', prefix, 'string')
|
||||
--- ...
|
||||
--- -- ...
|
||||
--- end
|
||||
--- ```
|
||||
---
|
||||
@@ -979,7 +979,7 @@ do
|
||||
--- age={age, 'number'},
|
||||
--- hobbies={hobbies, 'table'},
|
||||
--- }
|
||||
--- ...
|
||||
--- -- ...
|
||||
--- end
|
||||
--- ```
|
||||
---
|
||||
|
||||
@@ -292,7 +292,7 @@ end)
|
||||
--- - `captures`: a list of unique capture names defined in the query (alias: `info.captures`).
|
||||
--- - `info.patterns`: information about predicates.
|
||||
---
|
||||
--- Example (select the code then run `:'<,'>lua` to try it):
|
||||
--- Example (to try it, use `yxx` or select the code then run `:'<,'>lua`):
|
||||
--- ```lua
|
||||
--- local query = vim.treesitter.query.parse('vimdoc', [[
|
||||
--- ; query
|
||||
@@ -983,7 +983,7 @@ end
|
||||
--- -- `node` was captured by the `name` capture in the match
|
||||
---
|
||||
--- local node_data = metadata[id] -- Node level metadata
|
||||
--- ... use the info here ...
|
||||
--- -- ... use the info here ...
|
||||
--- end
|
||||
--- end
|
||||
--- end
|
||||
|
||||
Reference in New Issue
Block a user