Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(keybindings): add binding for opening config #3352

Merged
merged 5 commits into from
Apr 2, 2021

Conversation

LiHRaM
Copy link
Contributor

@LiHRaM LiHRaM commented Mar 31, 2021

Listed in #1423 as a good place to get started as adding a keybinding for the "Open Settings" shortcut. Hope it's okay!

(I accidentally force pushed to master when tracking upstream, so setting this to a different branch now. Unfortunately GitHub doesn't seem to allow me to change the tracking downstream branch after opening an issue...)

@bryphe bryphe added this to the 0.5.6 milestone Apr 1, 2021
@bryphe
Copy link
Member

bryphe commented Apr 1, 2021

Hi @LiHRaM ,

Sorry for the slow reply! Thank you for the PR, really appreciate the contribution 🎉

Made a couple small tweaks; but when CI is green, will merge.

let command = Commands.openConfigurationFile.id;

let openConfigOnMac =
bind(~key="<D-,>", ~condition="isMac" |> WhenExpr.parse, ~command);
Copy link
Member

Choose a reason for hiding this comment

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

I believe the condition is case-sensitive (which may be a bug itself) - flipped from IsMac -> isMac.

bind(~key="<D-,>", ~condition="isMac" |> WhenExpr.parse, ~command);

let openConfigOnOther =
bind(~key="<C-,>", ~condition="!isMac" |> WhenExpr.parse, ~command);
Copy link
Member

Choose a reason for hiding this comment

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

I was worried this might conflict with a default Vim keybinding, but doesn't appear that it does 👍

@@ -31,6 +31,7 @@ let defaultKeyBindings =
),
]
@ Feature_SideBar.Contributions.keybindings
@ Feature_Configuration.Contributions.keybindings
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for wiring this up!

@bryphe
Copy link
Member

bryphe commented Apr 2, 2021

Looks like the CI failure isn't related to this change; it's a bug with loading the cache. So I'll bring it now.

Thanks for the contribution, @LiHRaM - much appreciated!

@bryphe bryphe merged commit 381ac17 into onivim:master Apr 2, 2021
@LiHRaM LiHRaM deleted the 1432-open-config branch April 3, 2021 12:26
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