https://github.com/spaceshaman/window-shuffler.nvim
Smartly shuffle Neovim windows around – layout-aware and intuitive.
https://github.com/spaceshaman/window-shuffler.nvim
neovim neovim-plugin nvim nvim-plugin vim
Last synced: 2 months ago
JSON representation
Smartly shuffle Neovim windows around – layout-aware and intuitive.
- Host: GitHub
- URL: https://github.com/spaceshaman/window-shuffler.nvim
- Owner: SpaceShaman
- License: mit
- Created: 2025-07-03T15:55:44.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-07-24T15:27:51.000Z (11 months ago)
- Last Synced: 2025-09-15T02:25:20.129Z (9 months ago)
- Topics: neovim, neovim-plugin, nvim, nvim-plugin, vim
- Language: Lua
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
window-shuffler.nvim
Smartly shuffle Neovim windows around – layout-aware and intuitive.
## Features
* Move the current **window** in any direction: left, right, up, or down.
* Automatically finds the best possible placement based on existing layout.
* Respects window dimensions to keep your layout clean and consistent.
* Simple setup with fully customizable keymaps.
## Installation
Using [packer](https://github.com/wbthomason/packer.nvim):
```lua
use { "SpaceShaman/window-shuffler.nvim", tag = "*", config = function()
require("window-shuffler").setup()
end }
```
Using [lazy.nvim](https://github.com/folke/lazy.nvim):
```lua
{
"SpaceShaman/window-shuffler.nvim",
version = "*",
opts = {
-- Optional custom keymaps
},
}
```
Using [vim-plug](https://github.com/junegunn/vim-plug):
```vim
Plug 'SpaceShaman/window-shuffler.nvim', {'tag': '*'}
lua require("window-shuffler").setup()
```
You can (and should) pin the plugin to a tag to avoid breaking changes as development continues.
## Configuration
You can configure the plugin by passing a table to the `setup()` function:
```lua
require("window-shuffler").setup({
keymaps = {
left = "H",
down = "J",
up = "K",
right = "L",
},
})
```
Or by using the `opts` field in your lazy.nvim config:
```lua
{
"SpaceShaman/window-shuffler.nvim",
opts = {
keymaps = {
left = "H",
down = "J",
up = "K",
right = "L",
},
},
}
```
### `keymaps`
A table of keybindings for directional movement. Default values are:
* `H`: Move current window to the left.
* `J`: Move current window downward.
* `K`: Move current window upward.
* `L`: Move current window to the right.
## How it works
When you trigger a directional move, the plugin searches for the most logical location in that direction – for example, it may go around obstacles to maintain the layout's flow. It ensures the moved window integrates cleanly with the rest of your layout.