https://github.com/dpi0/fim.nvim
Simple Neovim plugin for managing floating terminal instances
https://github.com/dpi0/fim.nvim
float neovim nvim terminal
Last synced: 9 months ago
JSON representation
Simple Neovim plugin for managing floating terminal instances
- Host: GitHub
- URL: https://github.com/dpi0/fim.nvim
- Owner: dpi0
- License: mit
- Created: 2025-03-22T10:05:12.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-26T04:32:24.000Z (9 months ago)
- Last Synced: 2025-03-26T05:26:09.764Z (9 months ago)
- Topics: float, neovim, nvim, terminal
- Language: Lua
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
fim.nvim
A simple Neovim plugin for managing floating terminal instances.

## ⚡ Installation
[lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
"dpi0/fim.nvim",
config = function()
require("fim").setup({
opts = {
width = 0.75,
height = 0.5,
border = "single",
position = 'center',
shell = vim.o.shell,
auto_insert = true,
auto_close = false
},
keys = {
t1 = "t1",
t2 = "t2",
t3 = "t3",
},
})
end
}
```
## ⚙️ Configuration
### Options
| Option | Default | Description |
| ------------- | ------------- | ----------------------------------------------------------------------------------- |
| `width` | `0.75` | Width as a fraction of the screen width |
| `height` | `0.5` | Height as a fraction of the screen height |
| `border` | `"single"` | Border style (`"single"`, `"double"`, `"rounded"`, `"solid"`, `"shadow"`, `"none"`) |
| `position` | `"center"` | Position on screen (`"center"`, `"top"`, `"bottom"`) |
| `shell` | `vim.o.shell` | Shell to use for terminals |
| `auto_insert` | `true` | Whether to automatically enter insert mode when opening a terminal |
| `auto_close` | `false` | Whether to close terminal when the process exits |
### Keybindings
**Default keybinds:**
```lua
keys = {
t1 = "t1", -- Toggle terminal 1
t2 = "t2", -- Toggle terminal 2
t3 = "t3", -- Toggle terminal 3
-- Add more as needed
}
```
**My preferred way of toggling terminals:**
```lua
-- Helper function for mappings
local function bind(mode, lhs, rhs, opts)
opts = opts or { noremap = true, silent = true }
vim.keymap.set(mode, lhs, rhs, opts)
end
bind("n", "", ":FimTerm 1")
bind("t", "", ":FimTerm 1")
bind("i", "", ":FimTerm 1")
bind("n", "", ":FimTerm 2")
bind("t", "", ":FimTerm 2")
bind("i", "", ":FimTerm 2")
```
## 💡 Usage
- Use your configured keybindings (like `t1`, `t2`, etc.) to toggle different terminal instances
- Use `:FimTerm [id]` command to toggle a terminal with a specific ID
- Use `:FimCloseAll` to close all terminal windows (but preserve processes)
- Use `:FimKillAll` to completely kill all terminals and their processes
- Press `` to exit insert mode in terminals
Each terminal instance maintains its state and running processes even when hidden. This makes it perfect for:
- Running multiple development servers
- Monitoring log outputs
- Running database clients
- Any task that requires a persistent terminal
## Contributing
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.