Skip to content

feat(window): add vim-style directional window moves#155

Merged
fcoury merged 1 commit into
masterfrom
fcoury/vim-window-edge-moves
Jul 25, 2026
Merged

feat(window): add vim-style directional window moves#155
fcoury merged 1 commit into
masterfrom
fcoury/vim-window-edge-moves

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

The existing Ctrl-w h/j/k/l bindings only change focus, so there is no Vim-compatible way to physically reposition the active split. Recreating a window to simulate movement would also lose stable window identity, viewport state, attached window bars, and unrelated split ratios.

What Changed

  • Add Ctrl-w H/J/K/L to move the active split to the full-height left/right or full-width top/bottom edge while keeping lowercase focus navigation unchanged.
  • Restructure the split tree without replacing the active window, preserving stable IDs, cursors, viewports, existing split ratios, session snapshots, and sidebar-reserved geometry.
  • Compare every window position and size when refreshing plugin snapshots so layout changes are delivered without incorrect window-close or focus events.
  • Add command-palette entries, prefix hints, documentation, legacy-configuration coverage, and unit and integration regressions.

How to Test

  1. Start Red, open a vertical split with Ctrl-w v, then a horizontal split with Ctrl-w s; open a different file in each pane.
  2. Press Ctrl-w H, Ctrl-w J, Ctrl-w K, and Ctrl-w L. Verify the active file moves to the full left, bottom, top, and right edge, remains focused, and retains its cursor.
  3. Open Neo-tree with Ctrl-e, repeat a window move, and verify the sidebar remains visible and the editor panes stay inside the reserved area.
  4. Verify lowercase Ctrl-w h/j/k/l still only changes focus. Repeat a move toward an already occupied outer edge and confirm it is a silent no-op.
  5. Run cargo test --lib window and cargo test --test editing --quiet to exercise stable IDs, plugins, recovery, real shifted key events, legacy keymaps, and side panels.

Validation

  • cargo test --all-features --quiet — 1,588 passing tests.
  • cargo clippy --all-targets --all-features -- -D warnings.
  • cargo fmt --all -- --check.
  • Interactive tmux smoke test for all four edge moves and Neo-tree.

@fcoury
fcoury merged commit 9e6fe19 into master Jul 25, 2026
18 checks passed
@fcoury
fcoury deleted the fcoury/vim-window-edge-moves branch July 25, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants