diff options
author | a-kenji <aks.kenji@protonmail.com> | 2021-11-14 22:58:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-14 22:58:20 +0100 |
commit | 347e02ea35793ba7e898ca0693f569a21525d459 (patch) | |
tree | beab3ed6f4102b96cffa8c7c7cfbaaa33d794943 /zellij-utils/src/input/keybinds.rs | |
parent | 96315ed332438374743d73d3e3b38c3cdbdc3331 (diff) |
feature(layout): add layout config (#866)
feature(layout): add layout config (#866)
* It is now possible to configure zellij through a layout:
The config file and the layout file will be merged, on conflicting
options the order is as follows:
1. config options `zellij options`
2. layout
3. config
Example:
```
---
template:
direction: Horizontal
parts:
- direction: Vertical
body: true
- direction: Vertical
borderless: true
split_size:
Fixed: 1
run:
plugin:
location: "zellij:tab-bar"
default_shell: fish
```
Diffstat (limited to 'zellij-utils/src/input/keybinds.rs')
-rw-r--r-- | zellij-utils/src/input/keybinds.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/zellij-utils/src/input/keybinds.rs b/zellij-utils/src/input/keybinds.rs index d3d0c7051..e3f88b1a0 100644 --- a/zellij-utils/src/input/keybinds.rs +++ b/zellij-utils/src/input/keybinds.rs @@ -16,7 +16,7 @@ pub struct ModeKeybinds(HashMap<Key, Vec<Action>>); /// Intermediate struct used for deserialisation /// Used in the config file. -#[derive(Clone, Debug, PartialEq, Deserialize)] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] pub struct KeybindsFromYaml { #[serde(flatten)] keybinds: HashMap<InputMode, Vec<KeyActionUnbind>>, @@ -25,7 +25,7 @@ pub struct KeybindsFromYaml { } /// Intermediate enum used for deserialisation -#[derive(Clone, Debug, PartialEq, Deserialize)] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] #[serde(untagged)] enum KeyActionUnbind { KeyAction(KeyActionFromYaml), @@ -40,21 +40,21 @@ struct KeyActionUnbindFromYaml { } /// Intermediate struct used for deserialisation -#[derive(Clone, Debug, PartialEq, Deserialize)] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] pub struct KeyActionFromYaml { action: Vec<Action>, key: Vec<Key>, } /// Intermediate struct used for deserialisation -#[derive(Clone, Debug, PartialEq, Deserialize)] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] struct UnbindFromYaml { unbind: Unbind, } /// List of keys, for which to disable their respective default actions /// `All` is a catch all, and will disable the default actions for all keys. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, Deserialize, Serialize)] #[serde(untagged)] enum Unbind { // This is the correct order, don't rearrange! @@ -168,7 +168,7 @@ impl Keybinds { /// Merges two Keybinds structs into one Keybinds struct /// `other` overrides the ModeKeybinds of `self`. - fn merge_keybinds(&self, other: Keybinds) -> Keybinds { + pub fn merge_keybinds(&self, other: Keybinds) -> Keybinds { let mut keybinds = Keybinds::new(); for mode in InputMode::iter() { |