depot/third_party/home-manager/tests/modules/programs/zsh/history-substring-search.nix
Default email 75fa0ae5af Project import generated by Copybara.
GitOrigin-RevId: c3ab5ea047e6dc73df530948f7367455749d8906
2023-08-08 12:19:01 +02:00

25 lines
660 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.zsh = {
enable = true;
historySubstringSearch = {
enable = true;
searchDownKey = "^[[B";
searchUpKey = [ "^[[A" "\\eOA" ];
};
};
test.stubs.zsh = { };
# Written with regex to ensure we don't end up missing newlines in the future
nmt.script = ''
assertFileRegex home-files/.zshrc "^bindkey '\^\[\[B' history-substring-search-down$"
assertFileRegex home-files/.zshrc "^bindkey '\^\[\[A' history-substring-search-up$"
assertFileRegex home-files/.zshrc "^bindkey '\\\\eOA' history-substring-search-up$"
'';
};
}