-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add install/setup instructions
- Loading branch information
1 parent
12d115d
commit 3ccfefa
Showing
1 changed file
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,83 @@ | ||
# telescope-resession.nvim | ||
# 🔭 telescope-resession.nvim | ||
|
||
A telescope extension that adds a session picker to the wonderful [resession.nvim](https://github.com/stevearc/resession.nvim) plugin. | ||
|
||
## 📦 Extension Installation | ||
|
||
```lua | ||
{ | ||
"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, | ||
} | ||
``` | ||
|
||
## ⏪ Recommended Resession Configuration | ||
|
||
```lua | ||
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: | ||
|
||
```vim | ||
:Telescope resession | ||
``` | ||
|
||
Lua: | ||
|
||
```lua | ||
require("telescope").extensions.resession.resession() | ||
``` | ||
|
||
## 🎨 Customization | ||
|
||
```lua | ||
extensions = { | ||
resession = { | ||
prompt_title = "Your custom prompt title", | ||
|
||
-- Apply custom path substitutions to the session paths | ||
path_substitutions = { | ||
{ find = "/home/username", replace = "🏠" }, | ||
}, | ||
}, | ||
}, | ||
``` |