diff --git a/home/common/general.nix b/home/common/general.nix index dc95ada..7ff5817 100644 --- a/home/common/general.nix +++ b/home/common/general.nix @@ -77,6 +77,10 @@ # i only use this as a login shell bash = { enable = true; + initExtra = '' + bind -x '"\C-r": __atuin_history' + export ATUIN_NOBIND=true + ''; }; git = { enable = true; diff --git a/home/common/terminal.nix b/home/common/terminal.nix index edbffa3..7d1da54 100644 --- a/home/common/terminal.nix +++ b/home/common/terminal.nix @@ -82,7 +82,6 @@ in { extraConfig = { depth = 32; inheritPixmap = true; - # letterSpace = -1; }; scroll.bar.enable = false; fonts = [ diff --git a/home/common/zsh.nix b/home/common/zsh.nix index 97591fe..1083103 100644 --- a/home/common/zsh.nix +++ b/home/common/zsh.nix @@ -14,6 +14,22 @@ shellAliases.se = "sudo -AE"; # I dont want to remap the up key, so only map this, setting ATUIN_NOBIND to true initExtra = '' + up-line-or-local-history() { + zle set-local-history 1 + zle up-line-or-history + zle set-local-history 0 + } + zle -N up-line-or-local-history + down-line-or-local-history() { + zle set-local-history 1 + zle down-line-or-history + zle set-local-history 0 + } + zle -N down-line-or-local-history + bindkey '^[[A' up-line-or-local-history + bindkey '^[OA' up-line-or-local-history + bindkey '^[[B' down-line-or-local-history + bindkey '^[OB' down-line-or-local-history bindkey '^r' _atuin_search_widget ''; localVariables = {