File tree Expand file tree Collapse file tree 2 files changed +9
-41
lines changed
tests/modules/programs/zsh Expand file tree Collapse file tree 2 files changed +9
-41
lines changed Original file line number Diff line number Diff line change 247247 # https://github.com/zsh-users/zsh-history-substring-search#usage
248248 ''
249249 source ${ pkgs . zsh-history-substring-search } /share/zsh-history-substring-search/zsh-history-substring-search.zsh
250-
251- ${
252- let
253- upKeys = lib . toList cfg . historySubstringSearch . searchUpKey ;
254- downKeys = lib . toList cfg . historySubstringSearch . searchDownKey ;
255- in
256- ''
257- # Bind search up keys
258- ${ lib . hm . zsh . define "search_up_keys" upKeys }
259- for key in "'' ${search_up_keys[@]}"; do
260- bindkey "$key" history-substring-search-up
261- done
262- unset key search_up_keys
263-
264- # Bind search down keys
265- ${ lib . hm . zsh . define "search_down_keys" downKeys }
266- for key in "'' ${search_down_keys[@]}"; do
267- bindkey "$key" history-substring-search-down
268- done
269- unset key search_down_keys
270- ''
271- }
250+ ${ lib . concatMapStringsSep "\n " ( upKey : ''bindkey "${ upKey } " history-substring-search-up'' ) (
251+ lib . toList cfg . historySubstringSearch . searchUpKey
252+ ) }
253+ ${ lib . concatMapStringsSep "\n " ( downKey : ''bindkey "${ downKey } " history-substring-search-down'' ) (
254+ lib . toList cfg . historySubstringSearch . searchDownKey
255+ ) }
272256 ''
273257 ) )
274258 ] ;
Original file line number Diff line number Diff line change 3636unset opt disabled_opts
3737
3838source @zsh-history-substring-search@/share/zsh-history-substring-search/zsh-history-substring-search.zsh
39-
40- # Bind search up keys
41- search_up_keys=(
42- '^[[A' '\eOA'
43- )
44- for key in "${search_up_keys[@]}"; do
45- bindkey "$key" history-substring-search-up
46- done
47- unset key search_up_keys
48-
49- # Bind search down keys
50- search_down_keys=(
51- '^[[B'
52- )
53- for key in "${search_down_keys[@]}"; do
54- bindkey "$key" history-substring-search-down
55- done
56- unset key search_down_keys
57-
39+ bindkey "^[[A" history-substring-search-up
40+ bindkey "\eOA" history-substring-search-up
41+ bindkey "^[[B" history-substring-search-down
You can’t perform that action at this time.
0 commit comments