1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-02 21:13:33 +02:00
home-manager/tests/modules/programs/zsh/history-substring-search.nix
Bernardo Meurer 3144311f31
zsh: allow multiple bindings to history-substring-search (#3929)
It's pretty common to need multiple bindings to
history-substring-search, since different terminals will send different
keys for up/down.

This does not break back-compatibility, and introduces a new test
2023-04-29 16:53:09 +02:00

26 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$"
'';
};
}