An open API service indexing awesome lists of open source software.

https://github.com/mathiew82/phantom.nvim

A minimal Neovim plugin for working with sessions.
https://github.com/mathiew82/phantom.nvim

manager neovim neovim-plugin nvim sessions

Last synced: 2 months ago
JSON representation

A minimal Neovim plugin for working with sessions.

Awesome Lists containing this project

README

          

# 👻 phantom.nvim

Minimal session manager for Neovim with a floating UI.


screenshot

Phantom lets you manage sessions from a single window:

- List sessions
- Load sessions (with buffer wipe)
- Save current session
- Delete sessions

No commands to remember.
One key. One UI.

## Requirements

- Neovim \>= 0.11.0

## Features

- Floating window UI
- Save / load / delete from the same window
- Buffer wipe before loading (no mixing)
- Works with lazy.nvim
- Cross-platform (Linux, macOS, Windows)
- No dependencies

## Installation (Lazy.nvim / LazyVim)

### lazy.nvim

```lua
{
"Mathiew82/phantom.nvim",
event = "VeryLazy",
config = function()
require("phantom").setup()
end,
}
```

### packer.nvim

```lua
use {
"Mathiew82/phantom.nvim",
config = function()
require("phantom").setup()
end
}
```

### vim-plug

```vim
Plug 'Mathiew82/phantom.nvim'
```

## Usage

Open session panel:

- `sls`
- `:Phantom`

Close window:

- `q`
- ``

## Configuration

Default config:

``` lua
require("phantom").setup({
session_dir = vim.fn.stdpath("state") .. "/sessions",
notify = true,
wipe_on_load = true,
keymaps = {
list = "sls",
},
float = {
border = "rounded",
width = 60,
height = 16,
title = "Phantom Sessions",
},
})
```

You can customize the plugin by passing options to `setup()`:

```lua
require("phantom").setup({
-- Directory where session files are stored
-- Default: stdpath("state") .. "/sessions"
session_dir = vim.fn.stdpath("state") .. "/sessions",

-- Show notifications (vim.notify)
-- true = show feedback messages
-- false = silent mode
notify = true,

-- Wipe all buffers before loading a session
-- true = clean state (recommended)
-- false = keep current buffers (may mix)
wipe_on_load = true,

-- Keymaps
keymaps = {
-- Open Phantom floating UI
list = "sls",
},

-- Floating window settings
float = {
-- Window border style
-- Options:
-- "single", "double", "rounded", "solid", "shadow", nil
border = "rounded",

-- Floating window width (in columns)
width = 60,

-- Floating window height (in lines)
height = 16,

-- Window title
title = "Phantom Sessions",
},
})
```

> [!TIP]
> For more information about this plugin, see also:
> ```
> :help phantom
> ```