Skip to content

roosta/telescope-folds.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔎 telescope-folds.nvim

Neovim plugin that lets you fuzzy search for folds in a file using Telescope.

Requirements

telescope.nvim is required for this plugin to work.

Installation

Use your favorite plugin manager, for example with packer.nvim:

use {
  'roosta/telescope-folds.nvim',
  requires = {'nvim-telescope/telescope.nvim'},
  config = function()
    require('telescope').load_extension('folds')
  end
}

Or with lazy.nvim:

{
  'roosta/telescope-folds.nvim',
  dependencies = {'nvim-telescope/telescope.nvim'},
  config = function()
    require('telescope').load_extension('folds')
  end
}

Usage instructions

telescope-folds introduces a command :Folds and a Telescope extension.

Command

:Folds

Open a Telescope picker and search for folds in the current file. On selection, telescope-folds will move you to that fold's line number and open just enough folds to show the fold you selected (zv).

Lua API

require('telescope').extensions.folds.folds()

Keymapping

It can be useful to bind this command to something:

-- Vim script
vim.cmd([[nnoremap <leader>jf :Folds<CR>]])

-- Lua
vim.keymap.set('n', '<leader>jf', ':Folds<CR>', { noremap = true, silent = true })
-- or
vim.keymap.set('n', '<leader>jf', function()
  require('telescope').extensions.folds.folds()
end, { noremap = true, silent = true })

Related projects

Background

This is a lua port of fzf-folds.vim which was written in vimscript and using fzf.vim as an interface. That plugin was in turn inspired by foldlist, which was inspired by taglist.

License

MIT

About

Neovim plugin that lets you fuzzy search for folds in a file using Telescope.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors