aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/help.lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-06-08 10:49:15 +0200
committerChristian Clason <c.clason@uni-graz.at>2024-06-09 13:54:34 +0200
commit6592873f773b4c358ea950bfcfa8cbc3fc3bc8cc (patch)
treefdcab6ee2dc7cd292081da116edbe05ef0ef4206 /runtime/ftplugin/help.lua
parent105a9e3dcf95ba64e7737a479579e20063ead0bb (diff)
downloadrneovim-6592873f773b4c358ea950bfcfa8cbc3fc3bc8cc.tar.gz
rneovim-6592873f773b4c358ea950bfcfa8cbc3fc3bc8cc.tar.bz2
rneovim-6592873f773b4c358ea950bfcfa8cbc3fc3bc8cc.zip
feat(help): use treesitter for table of contents
Problem: Creating the table of contents for `gO` is complicated. Solution: Use treesitter instead.
Diffstat (limited to 'runtime/ftplugin/help.lua')
-rw-r--r--runtime/ftplugin/help.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua
index 67c417b1be..86e181504f 100644
--- a/runtime/ftplugin/help.lua
+++ b/runtime/ftplugin/help.lua
@@ -26,3 +26,7 @@ elseif vim.endswith(bufname, '/doc/lsp.txt') then
{ start = [[\*lsp-semantic-highlight\*]], stop = '^======', match = '^@[%w%p]+' },
})
end
+
+vim.keymap.set('n', 'gO', function()
+ require('vim.vimhelp').show_toc()
+end, { buffer = 0, silent = true })