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

Add extraConfig to programs.zellij #6078

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dietr1ch
Copy link

Description

This allows working around #4659
While fixing toKDL might be fun, I just don't think it's a good use of anyone's time.

This is still untested as I'm not yet familiar with testing changes here.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

Maintainer CC

@mainrs

@Dietr1ch Dietr1ch force-pushed the dev/zellij-extraConfig branch 2 times, most recently from 786819c to fc92e4a Compare November 13, 2024 23:08
@Dietr1ch
Copy link
Author

Tested locally after tracking my own fork.

  inputs = {
    nixpkgs = {
      url = "github:nixos/nixpkgs/nixos-unstable";
    };
    home-manager = {
      url = "github:Dietr1ch/home-manager/test";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
/// (Config added by regular programs.zellij.settings)
default_layout "compact"
default_mode "locked"
theme "nord"

// extraConfig

keybinds {
    // keybinds are divided into modes
    normal {
        // bind instructions can include one or more keys (both keys will be bound separately)
        // bind keys can include one or more actions (all actions will be performed with no sequential guarantees)
        bind "Ctrl g" { SwitchToMode "locked"; }
        bind "Ctrl p" { SwitchToMode "pane"; }
        bind "Alt n" { NewPane; }
        bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
    }
    pane {
        bind "h" "Left" { MoveFocus "Left"; }
        bind "l" "Right" { MoveFocus "Right"; }
        bind "j" "Down" { MoveFocus "Down"; }
        bind "k" "Up" { MoveFocus "Up"; }
        bind "p" { SwitchFocus; }
    }
    locked {
        bind "Ctrl g" { SwitchToMode "normal"; }
    }
}

@Dietr1ch
Copy link
Author

I'd not mind adding a fixed output test, but I'm not sure exactly where it should live.

Are there any examples in the repo I can mimic and learn a bit?

@Adda0
Copy link

Adda0 commented Nov 14, 2024

Thanks for the PR. I will definitely investigate it later.

I'd not mind adding a fixed output test, but I'm not sure exactly where it should live.

Just a non-authoritative suggestion: Have a look at #6037. You can extend the test file similarly to what I did. I believe that is what you want in this case.

This allows working around [nix-community#4659](nix-community#4659)

While fixing `toKDL` might be fun, I just don't think it's a good use of
anyone's time.

---

This is still untested.
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