fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Kiran Ostrolenkzsh: generalize zsh-history-substring-search9a2ce656

master
666 B25 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5{
6  config = {
7    programs.zsh = {
8      enable = true;
9      historySubstringSearch = {
10        enable = true;
11        searchDownKey = "^[[B";
12        searchUpKey = [ "^[[A" "\\eOA" ];
13      };
14    };
15
16    test.stubs.zsh = { };
17
18    # Written with regex to ensure we don't end up missing newlines in the future
19    nmt.script = ''
20      assertFileRegex home-files/.zshrc "^bindkey \"\^\[\[B\" history-substring-search-down$"
21      assertFileRegex home-files/.zshrc "^bindkey \"\^\[\[A\" history-substring-search-up$"
22      assertFileRegex home-files/.zshrc "^bindkey \"\\\\eOA\" history-substring-search-up$"
23    '';
24  };
25}