Skip to content

Add default_split tunable to control <C-W>f split direction#620

Open
stevenpollack wants to merge 4 commits into
ulyssa:mainfrom
stevenpollack:issue-415
Open

Add default_split tunable to control <C-W>f split direction#620
stevenpollack wants to merge 4 commits into
ulyssa:mainfrom
stevenpollack:issue-415

Conversation

@stevenpollack

@stevenpollack stevenpollack commented Jun 3, 2026

Copy link
Copy Markdown

Summary

Closes #415.

<C-W>f (open item under cursor in a split) currently hardcodes a horizontal split. Users who prefer vertical splits had to work around this with a macro like "f" = "<C-w>f<C-w><S-l>".

This PR adds a default_split tunable ("horizontal" by default, preserving current behaviour) that, when set to "vertical", overrides <C-W>f and <C-W><C-F> to open in a vertical split instead.

Config usage:

[settings]
default_split = "vertical"

Implementation notes

  • SplitDirection enum added to config.rs, following the same #[serde(rename_all = "lowercase")] pattern as UserDisplayStyle.
  • ApplicationSettings::setup() in keybindings.rs calls bindings.add_mapping for the two affected key sequences when default_split = "vertical". This works because the underlying keybindings crate's upsert_node overwrites a node's action when a later registration targets an already-registered key sequence — so it cleanly overrides the horizontal binding that modalkit registers during VimBindings::setup.
  • No modalkit changes required.

Test plan

  • Build with cargo build
  • Run cargo test --locked
  • With default_split = "vertical" in config, confirm <C-W>f on a room in the room list opens it in a vertical split
  • Without the setting (or with "horizontal"), confirm existing behaviour is unchanged

stevenpollack and others added 2 commits June 3, 2026 12:42
When set to "vertical" in config, overrides the default horizontal
split used by <C-W>f / <C-W><C-F>, matching the Vim-style workaround
users were applying manually.

Closes ulyssa#415

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previous opened to the left, which is the opposite of the file-manager
pattern where selecting an item in the left panel reveals it on the right.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@VAWVAW

VAWVAW commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Please add documentation to docs/iamb.5.

stevenpollack and others added 2 commits June 3, 2026 20:47
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stevenpollack

Copy link
Copy Markdown
Author

@VAWVAW done! Sorry for the omission. Completely slipped my eye.

@stevenpollack

Copy link
Copy Markdown
Author

bump for freshness.

@VAWVAW

VAWVAW commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This is a really slow moving project. It might be a few weeks or months until you get a reaction from a maintainer.

@stevenpollack

Copy link
Copy Markdown
Author

This is a really slow moving project. It might be a few weeks or months until you get a reaction from a maintainer.

fair enough! thanks for the head's up. =)

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.

Open identifier in V Split

2 participants