• Stars
    star
    586
  • Rank 76,279 (Top 2 %)
  • Language
    Lua
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

telescope-project.nvim

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

Demo

Demo

Requirements

Setup

You can setup the extension by adding the following to your config:

require'telescope'.load_extension('project')

You may skip explicitly loading extensions (they will then be lazy-loaded), but tab completions will not be available right away.

Available functions:

Project

The projects picker:

require'telescope'.extensions.project.project{}

Default mappings (normal mode):

Key Description
d delete currently selected project
r rename currently selected project
c create a project*
s search inside files within your project
b browse inside files within your project
w change to the selected project's directory without opening it
R find a recently opened file within your project
f find a file within your project (same as <CR>)

Default mappings (insert mode):

Key Description
<c-d> delete currently selected project
<c-v> rename currently selected project
<c-a> create a project*
<c-s> search inside files within your project
<c-b> browse inside files within your project
<c-l> change to the selected project's directory without opening it
<c-r> find a recently opened file within your project
<c-f> find a file within your project (same as <CR>)

* defaults to your git root if used inside a git project, otherwise, it will use your current working directory

Workspace mappings (insert mode):

Key Description
<c-w> change workspace

Example key map config:

vim.api.nvim_set_keymap(
        'n',
        '<C-p>',
        ":lua require'telescope'.extensions.project.project{}<CR>",
        {noremap = true, silent = true}
)

Available options:

Keys Description Options
display_type Show the title and the path of the project 'full' or 'minimal' (default)

Options can be added when requiring telescope-project, as shown below:

lua require'telescope'.extensions.project.project{ display_type = 'full' }

Available setup settings:

Keys Description Options
base_dirs Array of project base directory configurations table (default: nil)
hidden_files Show hidden files in selected project bool (default: false)
order_by Order projects by asc, desc, recent string (default: recent)
sync_with_nvim_tree Sync projects with nvim tree plugin bool (default: false)
search_by Telescope finder search by field (title/path) string (default: title)
on_project_selected Custom handler when project is selected function(prompt_bufnr) (default: find project files)
Setup settings can be added when requiring telescope, as shown below:
require('telescope').setup {
  local project_actions = require("telescope._extensions.project.actions")
  extensions = {
    project = {
      base_dirs = {
        '~/dev/src',
        {'~/dev/src2'},
        {'~/dev/src3', max_depth = 4},
        {path = '~/dev/src4'},
        {path = '~/dev/src5', max_depth = 2},
      },
      hidden_files = true, -- default: false
      theme = "dropdown",
      order_by = "asc",
      search_by = "title",
      sync_with_nvim_tree = true, -- default false
      -- default for on_project_selected = find project files
      on_project_selected = function(prompt_bufnr)
        -- Do anything you want in here. For example:
        project_actions.change_working_directory(prompt_bufnr, false)
        require("harpoon.ui").nav_file(1)
      end
    }
  }
}

Roadmap 🚙

  • order projects by last opened ✔️
  • add all (git-enabled) subdirectories automatically ✔️
  • workspaces 🚧

More Repositories

1

telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.
Lua
11,260
star
2

telescope-file-browser.nvim

File Browser extension for telescope.nvim
Lua
1,675
star
3

telescope-fzf-native.nvim

FZF sorter for telescope written in c
C
1,400
star
4

telescope-frecency.nvim

A telescope.nvim extension that offers intelligent prioritization when selecting files from your editing history.
Lua
783
star
5

telescope-live-grep-args.nvim

Live grep with args
Lua
597
star
6

telescope-media-files.nvim

Telescope extension to preview media files using Ueberzug.
Lua
464
star
7

telescope-ui-select.nvim

Lua
404
star
8

telescope-dap.nvim

Integration for nvim-dap with telescope.nvim
Lua
310
star
9

telescope-github.nvim

Integration with github cli
Lua
217
star
10

telescope-symbols.nvim

Lua
193
star
11

telescope-packer.nvim

A Telescope extension that provides extra functionality for Packer.nvim
Lua
180
star
12

telescope-fzy-native.nvim

FZY style sorter that is compiled
Lua
162
star
13

telescope-bibtex.nvim

A telescope.nvim extension to search and paste bibtex entries into your TeX files.
Lua
111
star
14

telescope-smart-history.nvim

A history implementation that memorizes prompt input for a specific context
Lua
108
star
15

telescope-cheat.nvim

WIP integration
Lua
101
star
16

telescope-arecibo.nvim

A Neovim Telescope extension for searching the web!
Lua
90
star
17

telescope-hop.nvim

(Teles-)Hopping to the moon.
Lua
90
star
18

telescope-fzf-writer.nvim

Incorporating some fzf concepts with plenary jobs and telescope
Lua
71
star
19

telescope-rs.nvim

Experimental features for telescope in RUST? The safest telescope known to HUMANITY
45
star
20

telescope-vimspector.nvim

Integration for vimspector with telescope.nvim
Lua
38
star
21

telescope-z.nvim

Z integration for Telescope
Lua
35
star
22

telescope-node-modules.nvim

An extension that provides its users with node packages under node_modules directory
Lua
31
star
23

telescope-ghq.nvim

Lua
24
star
24

telescope-snippets.nvim

snippets.nvim integration
Lua
13
star