Skip to content

Commit

Permalink
feat(keybindings): add binding for opening config
Browse files Browse the repository at this point in the history
  • Loading branch information
LiHRaM committed Mar 26, 2021
1 parent a84bae7 commit 2eee58b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/Feature/Configuration/Feature_Configuration.re
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,22 @@ module Commands = {
);
};

module Keybindings = {
open Feature_Input.Schema;

let command = Commands.openConfigurationFile.id;

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

let openConfigOnOther =
bind(~key="<C-,>", ~condition="!IsMac" |> WhenExpr.parse, ~command);
};

// CONTRIBUTIONS

module Contributions = {
let commands = Commands.[openConfigurationFile, reload];

let keybindings = Keybindings.[openConfigOnMac, openConfigOnOther];
};
5 changes: 4 additions & 1 deletion src/Feature/Configuration/Feature_Configuration.rei
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ module GlobalConfiguration = GlobalConfiguration;

// CONTRIBUTIONS

module Contributions: {let commands: list(Oni_Core.Command.t(msg));};
module Contributions: {
let commands: list(Oni_Core.Command.t(msg));
let keybindings: list(Feature_Input.Schema.keybinding);
};

module Testing: {let transform: ConfigurationTransformer.t => msg;};
1 change: 1 addition & 0 deletions src/Model/State.re
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ let defaultKeyBindings =
),
]
@ Feature_SideBar.Contributions.keybindings
@ Feature_Configuration.Contributions.keybindings
@ Feature_Input.Schema.[
bind(
~key="<C-TAB>",
Expand Down

0 comments on commit 2eee58b

Please sign in to comment.