Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RutaTang/spectacle.nvim
Easily manage multiple sessions with telescope integration.
https://github.com/RutaTang/spectacle.nvim
lua neovim neovim-lua-plugin neovim-plugin neovim-session session session-management
Last synced: 14 days ago
JSON representation
Easily manage multiple sessions with telescope integration.
- Host: GitHub
- URL: https://github.com/RutaTang/spectacle.nvim
- Owner: RutaTang
- Created: 2023-05-13T07:51:44.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-28T06:06:07.000Z (about 1 year ago)
- Last Synced: 2024-07-31T20:51:52.771Z (3 months ago)
- Topics: lua, neovim, neovim-lua-plugin, neovim-plugin, neovim-session, session, session-management
- Language: Lua
- Homepage:
- Size: 698 KB
- Stars: 13
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-neovim - RutaTang/spectacle.nvim - Easily manage multiple sessions with telescope integration. (Session / Indent)
README
# Spectacle.nvim
The plugin is designed for working with mutiple sessions. With it, you can easily store and change your session. This plugin is closly integrated with telescope.nvim, so please make sure telescope.nvim is in your dependencies.
## Installnation
Using any plugin manager you like, here is how to use with lazy.nvim plugin manager:
```lua
require("lazy").setup({
{
"RutaTang/spectacle.nvim",
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim'
}
opts = {session_dir = "/path/of/dir/where/you/want/to/save/all/sessions"}
},
})
```## Configuration
So far only Configuration is to provide the path of the directory where your want to save all your session via passing ```session_dir``` in ```opts```, otherwise leave it as blank table i.e. ```opts = {}```, and it will save the session into directory ```.spectacle``` at the current working directory of the working file.
## API
| API | Description |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SpectacleSave()` | Save session |
| `SpectacleSaveAs()` | Save current session as a new session |
| `SpectacleTelescope()` | Open a telescope picker to manage sessions, you can press `` to select a session, `r` to rename a session, and `d` to delete a session, (Be sure you are in normal mode) |For example, you can call `SpectacleTelescope()` API like this:
```lua
:lua require('spectacle').SpectacleTelescope()
```You can also set a keymap to conviniently call the function like this:
```lua
vim.api.nvim_set_keymap("n", "t", ":lua require('spectacle').SpectacleTelescope()",{})
```## How it works
It simply saves the session content generated from command `:mksession` to a folder named `.spectacle` stored in current working directory. The session file stored in `.spectacle` folder stands for a single session. Its name is the session name. For example, conisder you create a session named `default`, its session file `default.vim` will be stored in `.spectacle`.