Skip to content

Modal modifiers#249

Open
sabberworm wants to merge 3 commits intojigish:masterfrom
sabberworm:modal-modifiers
Open

Modal modifiers#249
sabberworm wants to merge 3 commits intojigish:masterfrom
sabberworm:modal-modifiers

Conversation

@sabberworm
Copy link
Copy Markdown
Contributor

Closes #247 as fixed

sabberworm and others added 3 commits February 20, 2013 16:25
A key bound like

	key:modal;modifier

Behaves the way it always has: the modifier is applied to the key that enters modal mode.

A key bound like

	key:modifier;modal

Now behaves as follows: the modifier has to be pressed with the key that triggers the action while in modal mode.

Of course, the two can also be combined:

	key:modifier1;modal;modifier2

behaves as you’d expect: modal mode is activated when `modal` is pressed along with `modifier2`
and the command is executed if `key` is pressed along with `modifier1` while in modal mode.

combinations followed by `:toggle` also work
@hunner
Copy link
Copy Markdown

hunner commented Jun 26, 2013

+1 to this feature, though I would probably go with the format bind up,cmd:f9 to enter modal mode with f9 and use cmd+up as the key combo rather than the described format of bind up:cmd;f9

Comment thread README.md
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe one of your examples is missing a ; and has a , instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both comma and semicolon are valid to separate modifiers from each other. This has always been the case and I didn’t want to change anything.

@sabberworm
Copy link
Copy Markdown
Contributor Author

On Jun 27, 2013, at 12:37 AM, Hunter Haugen notifications@github.com wrote:

+1 to this feature, though I would probably go with the format bind up,cmd:f9 to enter modal mode with f9 and use cmd+up as the key combo rather than the described format of bind up:cmd;f9

I agree that the syntax could be cleaner. Your suggestion, however, would break backwards compatibility: The format has always been

bind key:modifiers operation parameter+
bind key:modal-key operation parameter+

for both modes. Where modifiers and modal-key both are comma-or-semicolon-separated lists. The only thing I changed is that now the order of the items in that list is important: all the modifiers that come before a modal-key are thought to modify the key whereas all the modifiers that come after it modify the modal-key.

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.

Using modifiers with modal keys

2 participants