Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tamton-aquib/flirt.nvim
A neovim plugin to work with floating windows.
https://github.com/tamton-aquib/flirt.nvim
hacktoberfest hacktoberfest2023 lua neovim neovim-plugin nvim vim
Last synced: about 2 months ago
JSON representation
A neovim plugin to work with floating windows.
- Host: GitHub
- URL: https://github.com/tamton-aquib/flirt.nvim
- Owner: tamton-aquib
- Created: 2022-10-05T09:29:40.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T07:44:06.000Z (about 1 year ago)
- Last Synced: 2024-07-03T13:23:30.076Z (3 months ago)
- Topics: hacktoberfest, hacktoberfest2023, lua, neovim, neovim-plugin, nvim, vim
- Language: Lua
- Homepage:
- Size: 11.7 KB
- Stars: 101
- Watchers: 3
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flirt.nvim
Animations for floating windows in neovim.
Was about to name this float.nvim but god said "no".TLDR: Animations + Resizing + Moving floating windows.
> **Warning**
> Highly experimental.
> Overrides the default `nvim_open_win` to achieve the open animation effect.### Showcase
https://user-images.githubusercontent.com/77913442/194030746-1918f058-8bdb-486e-a740-e02a2b222f98.mp4
### Installation
```lua
use { 'tamton-aquib/flirt.nvim' }
```### Usage
```lua
require("flirt").setup()
```Click here to see default configuration
```lua
require("flirt").setup {
override_open = true, -- experimental
close_command = 'Q',
default_move_mappings = true, -- to move floats
default_resize_mappings = true, -- to resize floats
default_mouse_mappings = true, -- Drag floats with mouse
exclude_fts = {'notify', 'cmp_menu'},
speed = 95, -- Can vary from 1 to 100 (100 is fast)
custom_filter = function(buffer, win_config)
return vim.bo[buffer].filetype == 'cmp_menu' -- avoids animation
end
-- more options on the way.
}
```If you want to map to different keys:
```lua
local f = require("flirt")vim.keymap.set('n', '', function() f.move("left") end, {})
vim.keymap.set('n', '', function() f.move("up") end, {}) -- etc
```### NOTES
- Its a single file with approximately 200LOC
- Contributions are welcome for improvement.
- Extracted from [stuff.nvim](https://github.com/tamton-aquib/stuff.nvim)
- Might work well with [hydra.nvim](https://github.com/anuvyklack/hydra.nvim), haven't checked.### Credits
- [aloof](https://github.com/vsedov) for the idea.
- [vhyrro](https://github.com/vhyrro) for helping.
- [bryant](https://github.com/bryant-the-coder/) for the name.