Add default_split tunable to control <C-W>f split direction#620
Open
stevenpollack wants to merge 4 commits into
Open
Add default_split tunable to control <C-W>f split direction#620stevenpollack wants to merge 4 commits into
stevenpollack wants to merge 4 commits into
Conversation
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>
Contributor
|
Please add documentation to |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
@VAWVAW done! Sorry for the omission. Completely slipped my eye. |
Author
|
bump for freshness. |
Contributor
|
This is a really slow moving project. It might be a few weeks or months until you get a reaction from a maintainer. |
Author
fair enough! thanks for the head's up. =) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_splittunable ("horizontal"by default, preserving current behaviour) that, when set to"vertical", overrides<C-W>fand<C-W><C-F>to open in a vertical split instead.Config usage:
Implementation notes
SplitDirectionenum added toconfig.rs, following the same#[serde(rename_all = "lowercase")]pattern asUserDisplayStyle.ApplicationSettings::setup()inkeybindings.rscallsbindings.add_mappingfor the two affected key sequences whendefault_split = "vertical". This works because the underlyingkeybindingscrate'supsert_nodeoverwrites a node's action when a later registration targets an already-registered key sequence — so it cleanly overrides the horizontal binding that modalkit registers duringVimBindings::setup.Test plan
cargo buildcargo test --lockeddefault_split = "vertical"in config, confirm<C-W>fon a room in the room list opens it in a vertical split"horizontal"), confirm existing behaviour is unchanged