telescope-project.nvim icon indicating copy to clipboard operation
telescope-project.nvim copied to clipboard

feat: readme preview

Open lazytanuki opened this issue 3 years ago • 3 comments

Hi there !

Just a small PR to add the possibility to have a preview of the projects while browsing them. The preview shows the directory if no readme was found, and shows the readme if any from readme.{md,txt} and README.{md,txt}.

Here is a little demo:

telescope_project_demo

Some configuration options have been added to configure this feature :

require("telescope").setup {
    extensions = {
        project = {
            preview = {
                disable = false, -- default
                dir_only = false, -- default
                additional_readmes = {"notes.md", "notes.txt"} -- not default
            }
        }
    }
}

Thanks !

lazytanuki avatar Aug 24 '21 21:08 lazytanuki

Cool idea. :)

Can you make this configurable to be enabled and disabled on keypress? This doesnt look too useful to be always enabled, unless one searches on github for plugins.

Also calling readme is quite restricting. Think of BRANCH_TODO or other user-defined files of projects.

matu3ba avatar Nov 08 '21 21:11 matu3ba

Is this going to be merged?

iabdelkareem avatar Jun 23 '22 14:06 iabdelkareem

@lazytanuki I was thinking that a user function, which provides the pathnames to search, would be much more flexible and would also allow the user to use regexes to list the projects with a specific filepath pattern. What do you think?

As example: How can the user overwrite the defaults, say for example to search/list only the projects with a BRANCH_TODO ffile?

After this is clarified, a test case is needed. See here how telescope does it https://github.com/nvim-telescope/telescope.nvim/tree/master/lua/tests/pickers

matu3ba avatar Jun 28 '22 23:06 matu3ba