Skip to content

default-config: Bind swap to h/j/k/l in service mode - #2246

Closed
freqyfreqy wants to merge 1 commit into
nikitabobko:mainfrom
freqyfreqy:service-swap-bindings
Closed

default-config: Bind swap to h/j/k/l in service mode#2246
freqyfreqy wants to merge 1 commit into
nikitabobko:mainfrom
freqyfreqy:service-swap-bindings

Conversation

@freqyfreqy

Copy link
Copy Markdown

Changes

Adds four bindings to the default config's service mode:

h = 'swap left'
j = 'swap down'
k = 'swap up'
l = 'swap right'

Rationale is in the commit message: swap is under-discoverable (users only learn move and its tree-restructuring surprises); service mode already hosts join-with, so it becomes the complete restructure hub; bare h/j/k/l collide with no existing default binding; no mode main tail so swaps chain, esc exits as always.

Testing

  • ./test.sh — ✅ All tests have passed successfully (requires bash 5, installed via Homebrew to run it; the repo's own script/setup.sh gate)
  • Includes testParseDefaultConfig (default config parses with 0 errors / 0 warnings), lint.sh, generate.sh + check-uncommitted-files.sh (TOML-only change; no generated-file drift)

PR checklist

  • Explain your changes in the relevant commit messages rather than in the PR description. The PR description must not contain more information than the commit messages (except for images and other media).
  • Each commit must explain what/why/how and motivation in its description. https://cbea.ms/git-commit/
  • Don't forget to link the appropriate issues/discussions in commit messages (if applicable). (searched issues/PRs/discussions; no prior discussion found)
  • Each commit must be an atomic change (a PR may contain several commits). Don't introduce new functional changes together with refactorings in the same commit.
  • ./test.sh exits with zero exit code (suite passes).
  • Avoid merge commits, always rebase and force push.

'swap' is under-discoverable in the default config. Users learn
'alt-shift-h/j/k/l' as "move windows", hit the tree-restructuring
surprises of 'move' (cross-container moves reorder unrelated
windows), and never find the plain 2-window exchange they wanted.

The service mode is exactly the right place for it: it already
hosts join-with, so the mode becomes the "restructure" hub, and
within it the bare h/j/k/l keys mirror the directional focus
bindings of main mode. No key is stolen from existing default
bindings (bare h/j/k/l are bound in neither mode; 'move' keeps its
alt-shift chords in main mode).

Unlike the join-with bindings, these carry no 'mode main' tail, so
swaps can be chained while staying in service mode, with focus
following the window. Escape still exits.
@github-actions github-actions Bot added the not-actionable By default, all PRs have this label. If the PR makes sense, the label will be removed. label Aug 30, 2026
@nikitabobko

Copy link
Copy Markdown
Owner

'swap' is under-discoverable in the default config

Thanks for the raised concern, but I am not sure that the problem is legit.

Users can use mouse drag to discover it. Then it's a matter of assigning it in the default config if they prefer swap over move.

@nikitabobko nikitabobko removed the not-actionable By default, all PRs have this label. If the PR makes sense, the label will be removed. label Aug 31, 2026
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