An extension for telescope.nvim that allows you to switch between document's headings.
- Markdown, including
vimwiki
,vim-pandoc-syntax
, andvim-gfm-syntax
. - AsciiDoc
- LaTeX
- OrgMode
- Neorg
- ReStructuredText
- Vim Help
Install with your favorite package manager:
use('nvim-telescope/telescope.nvim')
use('crispgm/telescope-heading.nvim')
You can setup the extension by adding the following to your config:
require('telescope').load_extension('heading')
telescope-heading supports Tree-sitter for parsing documents and finding headings.
File types with Tree-sitter supports:
- Markdown
- ReStructuredText
- Neorg
- Vim Help
-- add nvim-treesitter
use('nvim-treesitter/nvim-treesitter')
-- make sure you have already installed treesitter modules
require('nvim-treesitter.configs').setup({
ensure_installed = {
-- ..
'markdown',
'rst',
-- ..
},
})
-- enable treesitter parsing
local telescope = require('telescope')
telescope.setup({
-- ...
extensions = {
heading = {
treesitter = true,
},
},
})
-- `load_extension` must be after `telescope.setup`
telescope.load_extension('heading')
If nvim-treesitter is not correctly loaded, it will fallback to normal parsing.
:Telescope heading
Init:
make init
Load telescope-heading locally:
nvim --noplugin -u scripts/minimal_init.vim ./README.md # replace with /path/to/testfile
# or
make test
Lint:
make lint