GithubHelp home page GithubHelp logo

wuqichuang / telescope-heading.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crispgm/telescope-heading.nvim

0.0 0.0 0.0 610 KB

An extension for telescope.nvim that allows you to switch between headings

License: MIT License

Lua 98.04% Makefile 1.21% Vim Script 0.75%

telescope-heading.nvim's Introduction

telescope-heading.nvim

Preview

GitHub CI GitHub Tag

An extension for telescope.nvim that allows you to switch between document's headings.

Supported File Types

  • Markdown, including vimwiki, vim-pandoc-syntax, and vim-gfm-syntax.
  • AsciiDoc
  • LaTeX
  • OrgMode
  • Neorg
  • ReStructuredText
  • Vim Help

Setup

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')

Tree-sitter Support

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.

Usage

:Telescope heading

Development

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

telescope-heading.nvim's People

Contributors

crispgm avatar younger-1 avatar guillaumeallain avatar jakobkhansen avatar mnacamura avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.