commit feb62d5429680278c1353c565db6bb3ecb3b7c24
parent ab9cfc4dc3422af5235759efef456d3e02745217
Author: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Date: Sun, 1 Dec 2024 16:58:28 -0500
docs: example keybind for :Inspect #31391
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
@@ -1911,6 +1911,11 @@ vim.show_pos({bufnr}, {row}, {col}, {filter}) *vim.show_pos()*
Can also be shown with `:Inspect`. *:Inspect*
+ Example: To bind this function to the vim-scriptease inspired `zS` in
+ Normal mode: >lua
+ vim.keymap.set('n', 'zS', vim.show_pos)
+<
+
Attributes: ~
Since: 0.9.0
diff --git a/runtime/lua/vim/_inspector.lua b/runtime/lua/vim/_inspector.lua
@@ -146,6 +146,13 @@ end
---
---Can also be shown with `:Inspect`. [:Inspect]()
---
+---Example: To bind this function to the vim-scriptease
+---inspired `zS` in Normal mode:
+---
+---```lua
+---vim.keymap.set('n', 'zS', vim.show_pos)
+---```
+---
---@since 11
---@param bufnr? integer defaults to the current buffer
---@param row? integer row to inspect, 0-based. Defaults to the row of the current cursor