Files
neovim/runtime/ftplugin/checkhealth.lua
skewb1k 4d3a67cd62 feat(lua): replace buffer with buf in vim.keymap.set/del #38360
The `buffer` option remains functional but is now undocumented.
Providing both will raise an error. Since providing `buf` was disallowed
before, there is no code that will break due to using `buffer` alongside
`buf`.
2026-03-21 12:00:06 -04:00

15 lines
679 B
Lua

vim.keymap.set('n', 'gO', function()
require('vim.treesitter._headings').show_toc(6)
end, { buf = 0, silent = true, desc = 'Show an Outline of the current buffer' })
vim.keymap.set('n', ']]', function()
require('vim.treesitter._headings').jump({ count = 1, level = 1 })
end, { buf = 0, silent = false, desc = 'Jump to next section' })
vim.keymap.set('n', '[[', function()
require('vim.treesitter._headings').jump({ count = -1, level = 1 })
end, { buf = 0, silent = false, desc = 'Jump to previous section' })
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
.. '\n sil! exe "nunmap <buffer> gO"'
.. '\n sil! exe "nunmap <buffer> ]]" | sil! exe "nunmap <buffer> [["'