https://github.com/ingur/floatty.nvim
A tiny (<200 LOC) but highly customizable floating terminal manager.
https://github.com/ingur/floatty.nvim
lazygit lua neovim neovim-plugin
Last synced: 9 days ago
JSON representation
A tiny (<200 LOC) but highly customizable floating terminal manager.
- Host: GitHub
- URL: https://github.com/ingur/floatty.nvim
- Owner: ingur
- License: mit
- Created: 2024-11-20T12:59:49.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-13T18:34:24.000Z (6 months ago)
- Last Synced: 2025-08-13T20:38:44.672Z (6 months ago)
- Topics: lazygit, lua, neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 43.9 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim-sorted - ingur/floatty.nvim
- awesome-neovim - ingur/floatty.nvim - A tiny (<200 LOC) but highly customizable floating terminal manager. (Terminal Integration / CSV Files)
README
floatty.nvim





A tiny (<200 LOC) but highly customizable floating terminal plugin.
Inspired by toggleterm.nvim but focused on simplicity.
## Features
- Easily toggle floating terminals and custom windows using `.toggle(opts)`.
- Customize window size, positioning, and appearance.
- Support for custom terminal commands (e.g [lazygit](#lazygit-float)), working directories, and window options.
## Requirements
- Neovim 0.11+
## Installation
Install with your favorite package manager. For example, in lazy.nvim:
```lua
{ "ingur/floatty.nvim" }
```
## Quickstart
```lua
-- initialize config
local term = require("floatty").setup({})
-- set toggle keybinds (supports v:count by default!)
vim.keymap.set('n', '', function() term.toggle() end)
vim.keymap.set('t', '', function() term.toggle() end)
```
> [!TIP]
> See more config examples [below](#config-examples)
## Defaults
```lua
-- NOTE: all options can be functions to be evaluated
local defaults = {
file = nil, -- File to open (if any)
cmd = vim.o.shell, -- Terminal command to run
cwd = vim.fn.getcwd, -- Working directory of the command
id = function() return vim.v.count end, -- Identifier for the float
start_in_insert = true, -- Start in insert mode
focus = true, -- Focus the window after opening
on_open = nil, -- Callback(config, buf) when buffer is created
on_exit = nil, -- Callback(config, buf) when buffer is destroyed
window = {
row = nil, -- Supports percentages (<=1) and absolute sizes (>1)
col = nil, -- Supports percentages (<=1) and absolute sizes (>1)
width = 0.8, -- Supports percentages (<=1) and absolute sizes (>1)
height = 0.8, -- Supports percentages (<=1) and absolute sizes (>1)
h_align = "center", -- "left", "center", "right" (used when col is nil)
v_align = "center", -- "top", "center", "bottom" (used when row is nil)
border = "rounded", -- Border style
zindex = 50, -- Z-index of the float
title = "", -- window title
title_pos = "center", -- "left", "center", "right"
-- see :h nvim_open_win() for more config options
},
wo = { -- Window-local options
cursorcolumn = false,
cursorline = false,
cursorlineopt = "both",
fillchars = "eob: ,lastline:…",
list = false,
listchars = "extends:…,tab: ",
number = false,
relativenumber = false,
signcolumn = "no",
spell = false,
winbar = "",
statuscolumn = "",
wrap = false,
sidescrolloff = 0,
-- other window options are also supported
},
}
```
## Config examples
### Bottom-aligned Terminal
```lua
local term = require("floatty").setup({
window = {
row = function() return vim.o.lines - 11 end,
width = 1.0,
height = 8,
},
})
vim.keymap.set('n', '', function() term.toggle() end)
vim.keymap.set('t', '', function() term.toggle() end)
```
### Lazygit float
```lua
local lazygit = require("floatty").setup({
cmd = "lazygit",
id = vim.fn.getcwd, -- Use the current working directory as the float's ID
})
vim.keymap.set('n', '', function() lazygit.toggle() end)
vim.keymap.set('t', '', function() lazygit.toggle() end)
```
### Toggling Between Horizontal and Vertical Layouts
```lua
local term = require("floatty").setup()
local layout = "horizontal"
term.toggle_layout = function()
layout = layout == "horizontal" and "vertical" or "horizontal"
if layout == "horizontal" then
term.window = {
row = function() return vim.o.lines - 11 end,
width = 1.0,
height = 8,
h_align = "center",
}
else
term.window = {
row = nil,
height = function() return vim.o.lines - 3 end,
width = 0.25,
h_align = "right",
v_align = "top",
}
end
end
vim.keymap.set('n', 'tt', term.toggle_layout)
```