From d2ccc615e53d9d8e04538559b34e26f95a8e9dcf Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Tue, 22 Feb 2022 19:04:22 -0500 Subject: [PATCH] Bring back some old autocomplete features --- configs/zsh/.zshrc | 1 + configs/zsh/autocomplete.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 configs/zsh/autocomplete.sh diff --git a/configs/zsh/.zshrc b/configs/zsh/.zshrc index 5ffce37..dace0c8 100644 --- a/configs/zsh/.zshrc +++ b/configs/zsh/.zshrc @@ -6,6 +6,7 @@ export EWCONFIG_ROOT="$HOME/.config/ewconfig" . $EWCONFIG_ROOT/configs/zsh/prompt.sh . $EWCONFIG_ROOT/configs/zsh/macros.sh . $EWCONFIG_ROOT/configs/zsh/keybinds.sh +. $EWCONFIG_ROOT/configs/zsh/autocomplete.sh # Load per-host configuration if [ -f $EWCONFIG_ROOT/configs/zsh/by_host/$HOSTNAME.sh ]; then diff --git a/configs/zsh/autocomplete.sh b/configs/zsh/autocomplete.sh new file mode 100644 index 0000000..868cd3b --- /dev/null +++ b/configs/zsh/autocomplete.sh @@ -0,0 +1,17 @@ + +# Handles case-insensitive completion +autoload -Uz compinit && compinit +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' + +# Configure command history +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 + +# Allow up arrow to be used to go back in history based on current line contents +autoload -U up-line-or-beginning-search +autoload -U down-line-or-beginning-search +zle -N up-line-or-beginning-search +zle -N down-line-or-beginning-search +bindkey "^[[A" up-line-or-beginning-search # Up +bindkey "^[[B" down-line-or-beginning-search # Down \ No newline at end of file