Home

Awesome

✨ telescope-pathogen.nvim

telescope-pathogen.nvim is a telescope extension to help you to navigate through different path when using builtin actions from telescope such as grep_string, find_files and live_grep.

⚡️ Usage scenarios

a

b

c

grep_in_files

Showcase on Youtube

file browser

A quick ui within telescope to pick up file or directory.

d

quick buffer

A swift way to switch buffer or pick recently opened file, use Telescope pathogen quick_buffer to launch it, which will list current buffers and some recently opened files, with each prefixed with a label. You can then press the labelled key(s) to switch to a buffer or open a file, if a key not from the labels are pressed, Telescope oldfiles will be launched for you to search old files.

The idea comes from Switch tabs feature of Surfingkeys.

quick_buffer

📦 Installation

Use lazy.nvim

{
    "nvim-telescope/telescope.nvim",
    dependencies = {
        { "telescope-pathogen.nvim" },
    },
    config = function()
        require("telescope").setup({
            extensions = {
                ["pathogen"] = {
                    attach_mappings = function(map, actions)
                        map("i", "<C-o>", actions.proceed_with_parent_dir)
                        map("i", "<C-l>", actions.revert_back_last_dir)
                        map("i", "<C-b>", actions.change_working_directory)
                        map("i", "<C-g>g", actions.grep_in_result)
                        map("i", "<C-g>i", actions.invert_grep_in_result)
                    end,
                    -- remove below if you want to enable it
                    use_last_search_for_live_grep = false,
                    -- quick_buffer_characters = "asdfgqwertzxcvb",
                    prompt_prefix_length = 100
                }
            },
        })
        require("telescope").load_extension("pathogen")
        vim.keymap.set('v', '<space>g', require("telescope").extensions["pathogen"].grep_string)
    end,
    keys = {
        { "<space>a", ":Telescope pathogen live_grep<CR>", silent = true },
        { "<C-p>", ":Telescope pathogen<CR>", silent = true },
        { "<C-f>", ":Telescope pathogen find_files<CR>", silent = true },
        { "<space>g", ":Telescope pathogen grep_string<CR>", silent = true },
    }
}