Go to file
Scott McKendry 9506a5b7d5 chore(ci):add basic tests 2024-06-23 14:32:01 +12:00
.github/workflows chore(ci):add basic tests 2024-06-23 14:32:01 +12:00
doc docs: auto-generate vimdoc 2024-06-23 00:09:57 +00:00
lua/telescope/_extensions chore(ci):add basic tests 2024-06-23 14:32:01 +12:00
tests chore(ci):add basic tests 2024-06-23 14:32:01 +12:00
.neovim.std.yml feat(ci): setup ci workflow and supporting configs 2024-06-22 21:32:49 +12:00
.selene.toml feat(ci): setup ci workflow and supporting configs 2024-06-22 21:32:49 +12:00
.stylua.toml feat(ci): setup ci workflow and supporting configs 2024-06-22 21:32:49 +12:00
CHANGELOG.md chore(main): release 0.1.0 (#1) 2024-06-23 12:11:02 +12:00
LICENSE chore: initial commit 2024-06-21 09:49:11 +12:00
README.md docs: add demo image to readme 2024-06-23 12:09:39 +12:00

README.md

🔭 telescope-resession.nvim

A telescope extension that adds a session picker to the wonderful resession.nvim plugin.

image

📦 Extension Installation

{
    "nvim-telescope/telescope.nvim",
    dependencies = { "scottmckendry/telescope-resession.nvim" },
    config = function()
        telescope.setup({
            -- Other telescope config...
            extensions = {
                resession = {
                        prompt_title = "Find Sessions", -- telescope prompt title
                        dir = "session", -- directory where resession stores sessions
                    },
                },
            },
        })
    end,
}
return {
    "stevearc/resession.nvim",
    config = function()
        local resession = require("resession")
        resession.setup({})

        -- Automatically save sessions on by working directory on exit
        vim.api.nvim_create_autocmd("VimLeavePre", {
            callback = function()
                resession.save(vim.fn.getcwd(), { notify = true })
            end,
        })

        -- Automatically load sessions on startup by working directory
        vim.api.nvim_create_autocmd("VimEnter", {
            callback = function()
                -- Only load the session if nvim was started with no args
                if vim.fn.argc(-1) == 0 then
                    resession.load(vim.fn.getcwd(), { silence_errors = true })
                end
            end,
            nested = true,
        })
    end,
}

🚀 Usage

Vim command:

:Telescope resession

Lua:

require("telescope").extensions.resession.resession()

🎨 Customization

extensions = {
    resession = {
        prompt_title = "Your custom prompt title",

        -- Apply custom path substitutions to the session paths
        path_substitutions = {
            { find = "/home/username", replace = "🏠" },
        },
    },
},