aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2025-01-09 08:36:16 -0800
committerGitHub <noreply@github.com>2025-01-09 08:36:16 -0800
commit0c296ab22484b4c009d119908d1614a6c6d96b2c (patch)
tree45ca8593392c49a0b514df69f97b9617fc2c874b /runtime/lua/vim
parent1e47aa677a24231ec771137dadc7c2b65be775b4 (diff)
downloadrneovim-0c296ab22484b4c009d119908d1614a6c6d96b2c.tar.gz
rneovim-0c296ab22484b4c009d119908d1614a6c6d96b2c.tar.bz2
rneovim-0c296ab22484b4c009d119908d1614a6c6d96b2c.zip
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>
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/shared.lua4
-rw-r--r--runtime/lua/vim/treesitter/query.lua4
2 files changed, 4 insertions, 4 deletions
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua
index 24c3f243e5..02b12490af 100644
--- a/runtime/lua/vim/shared.lua
+++ b/runtime/lua/vim/shared.lua
@@ -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
--- ```
---
diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua
index 1fc001b39f..b9bcbe9a80 100644
--- a/runtime/lua/vim/treesitter/query.lua
+++ b/runtime/lua/vim/treesitter/query.lua
@@ -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