diff --git a/users/common/shell/zsh/default.nix b/users/common/shell/zsh/default.nix index fc67003..add657f 100644 --- a/users/common/shell/zsh/default.nix +++ b/users/common/shell/zsh/default.nix @@ -19,16 +19,16 @@ unset HISTFILE '') (lib.mkAfter ('' - function atuin-prefix-search() { - local out - if out=$(${pkgs.sqlite}/bin/sqlite3 -readonly ~/.local/share/atuin/history.db \ - 'SELECT command FROM history WHERE command LIKE cast('"x'$(str_to_hex "$_atuin_search_prefix")'"' as text) || "%" ORDER BY timestamp DESC LIMIT 1 OFFSET '"$_atuin_search_offset"); then - [[ -z "$out" ]] && return 1 - BUFFER=$out - else - return 1 - fi - }; zle -N atuin-prefix-search + function atuin-prefix-search() { + local out + if out=$(${pkgs.sqlite}/bin/sqlite3 -readonly ~/.local/share/atuin/history.db \ + 'SELECT command FROM history WHERE command LIKE cast('"x'$(str_to_hex "$_atuin_search_prefix")'"' as text) || "%" ORDER BY timestamp DESC LIMIT 1 OFFSET '"$_atuin_search_offset"); then + [[ -z "$out" ]] && return 1 + BUFFER=$out + else + return 1 + fi + }; zle -N atuin-prefix-search '' + lib.readFile ./zshrc)) ]; diff --git a/users/common/shell/zsh/zshrc b/users/common/shell/zsh/zshrc index edae2da..e36038f 100644 --- a/users/common/shell/zsh/zshrc +++ b/users/common/shell/zsh/zshrc @@ -84,7 +84,7 @@ function setup_keybinds() { local keys_Backspace=( "${terminfo[kbs]}" '^?') local keys_CtrlBackspace=( "${terminfo[cub1]}" '^H') - local keys_AltBackspace=( "${terminfo[kbs]}" '\e^?') + local keys_AltBackspace=( '\e^?') local keys_Delete=( "${terminfo[kdch1]}" '\e[3~' ) local keys_ShiftDelete=( "${terminfo[kDC]}" '\e[3;2~' )