add an option to add the body key to emitted foreign keys #100
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.
This PR adds an option
prepend_body_to_foreign_keys
, as well as related docs in help andREADME.md
.The main use is to make kepmaps with the same leading body, but defined outside of this Hydra, reachable.
For example, if you have a Hydra with the body
CTRL-W
and 4 headsh
,j
,k
,l
, and nothing else, then, withprepend_body_to_foreign_keys = false
(default), when you pressv
, Hydra will passv
to nvim for process; on the other hand, withprepend_body_to_foreign_keys = true
, Hydra will sendCTRL-W_v
.In practice, when we set
prepend_body_to_foreign_keys=true
, the demo config of Windows and buffers management:can be simplified as:
We wouldn't need to re-define any built-in or custom keymaps here.
CTRL-W_?
is a great example, since nvim has 76 of them! This option can save us from having to repeat lots of the same patterns: