Skip to content

SpaceShaman/window-shuffler.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

use { "SpaceShaman/window-shuffler.nvim", tag = "*", config = function()
  require("window-shuffler").setup()
end }

Using lazy.nvim:

{
  "SpaceShaman/window-shuffler.nvim",
  version = "*",
  opts = {
    -- Optional custom keymaps
  },
}

Using vim-plug:

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:

require("window-shuffler").setup({
  keymaps = {
    left = "<C-w>H",
    down = "<C-w>J",
    up = "<C-w>K",
    right = "<C-w>L",
  },
})

Or by using the opts field in your lazy.nvim config:

{
  "SpaceShaman/window-shuffler.nvim",
  opts = {
    keymaps = {
      left = "<C-w>H",
      down = "<C-w>J",
      up = "<C-w>K",
      right = "<C-w>L",
    },
  },
}

keymaps

A table of keybindings for directional movement. Default values are:

  • <C-w>H: Move current window to the left.
  • <C-w>J: Move current window downward.
  • <C-w>K: Move current window upward.
  • <C-w>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.

About

Smartly shuffle Neovim windows around – layout-aware and intuitive.

Topics

Resources

License

Stars

Watchers

Forks

Languages