https://github.com/ycdzj/win-mover.nvim
Move Neovim windows easily.
https://github.com/ycdzj/win-mover.nvim
Last synced: over 1 year ago
JSON representation
Move Neovim windows easily.
- Host: GitHub
- URL: https://github.com/ycdzj/win-mover.nvim
- Owner: ycdzj
- License: mit
- Created: 2024-12-10T05:22:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-04T16:22:16.000Z (almost 2 years ago)
- Last Synced: 2025-01-04T17:24:49.453Z (almost 2 years ago)
- Language: Lua
- Homepage:
- Size: 819 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim-sorted - ycdzj/win-mover.nvim - Neovim window mover that avoids moving side windows (Split and Window)
- awesome-neovim - ycdzj/win-mover.nvim - Window mover that avoids moving side windows. (Split and Window / Indent)
README
# win-mover.nvim
`win-mover.nvim` is a Neovim window mover that ignores side windows.

## Features
- Window Move Mode similar to [WinShift.nvim](https://github.com/sindrets/winshift.nvim)
- Ignore side windows (e.g. NvimTree) so they will not move
- Simple implementation
## Requirements
- Neovim >= 0.8.0
## Installation
Install it with your favorite plugin manager:
### lazy
```lua
{
'ycdzj/win-mover.nvim',
lazy = false,
opts = {}, -- configuration goes here
}
```
### packer
```lua
use {
'ycdzj/win-mover.nvim',
config = function()
local win_mover = require('win-mover')
win_mover.setup({}) -- configuration goes here
end,
}
```
### vim-plug
1. Add this to your config:
```vim
Plug 'ycdzj/win-mover.nvim'
```
2. Call `require('win-mover').setup` with your configuration before using this plugin.
## Configuration
### Defaults
```lua
{
ignore = {
enable = false,
filetypes = {},
},
highlight = {
color = '#2e3440',
transparency = 60,
},
move_mode = {
keymap = {},
},
}
```
### Example
This is an example configuration that:
- Binds `e` for entering Move Mode.
- `h,j,k,l` to move window in Move Mode.
- `q` or `` to quit Move Mode.
- Ignores windows such as `NvimTree`, `neo-tree`, etc.
```lua
local win_mover = require('win-mover')
win_mover.setup({
ignore = {
enable = true,
filetypes = { 'NvimTree', 'neo-tree', 'Outline', 'toggleterm' },
},
move_mode = {
keymap = {
h = win_mover.ops.move_left,
j = win_mover.ops.move_down,
k = win_mover.ops.move_up,
l = win_mover.ops.move_right,
H = win_mover.ops.move_far_left,
J = win_mover.ops.move_far_down,
K = win_mover.ops.move_far_up,
L = win_mover.ops.move_far_right,
q = win_mover.ops.quit,
[''] = win_mover.ops.quit,
},
},
})
vim.keymap.set("n", "e", win_mover.enter_move_mode, { noremap = true, silent = true })
```
## Commands
- `:WinMover`
Enter Window Move Mode
## License
MIT License