owenrusk.dev

dotfiles

shell, editor, ssh.

git clone https://owenrusk.dev/dotfiles.git

commit 5ea074ea38ef2c9df9feb94a27c282cc9019bac8
parent 7ff5f06910992437cc275d9dc958e2d01b3e47dc
author Owen Rusk <owen@papermothgames.com>
date   2024-04-30 22:15:37 -0500
zsh: up and down search history by prefix
zsh/zshrc+9-0
diff --git a/zsh/zshrc b/zsh/zshrc
index 00d535d..4a834de 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -9,6 +9,15 @@ unsetopt flow_control   # ctrl-s is for searching, not for freezing the terminal
 
 bindkey -e
 
+# up and down search history for what's already typed
+autoload -Uz up-line-or-beginning-search down-line-or-beginning-search edit-command-line
+zle -N up-line-or-beginning-search
+zle -N down-line-or-beginning-search
+zle -N edit-command-line
+bindkey '^[[A' up-line-or-beginning-search
+bindkey '^[[B' down-line-or-beginning-search
+bindkey '^x^e' edit-command-line
+
 autoload -Uz compinit
 compinit -d ~/.cache/zcompdump
 zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'