From 8693f9157f83d1b4ad2a37705a0e15cf7e4b72bb Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 23 Jun 2021 21:30:46 +0200 Subject: [PATCH] Feat: add substring search for zsh --- files/dotfiles/zsh/.zshrc | 11 ++++++++++- tasks/dotfiles.yml | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/files/dotfiles/zsh/.zshrc b/files/dotfiles/zsh/.zshrc index 314423e..c9fb171 100644 --- a/files/dotfiles/zsh/.zshrc +++ b/files/dotfiles/zsh/.zshrc @@ -1,7 +1,7 @@ fpath+=$ZDOTDIR/pure autoload -U compinit -zstyle ':completion:*' menu select +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' menu select zmodload zsh/complist compinit _comp_options+=(globdots) # Include hidden files. @@ -52,6 +52,15 @@ ZSH_AUTOSUGGEST_STRATEGY=(history completion) # git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.config/zsh/ source ~/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +# Substring search +# git clone https://github.com/zsh-users/zsh-history-substring-search ~/.config/zsh +source ~/.config/zsh/zsh-history-substring-search/zsh-history-substring-search.zsh + +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down +bindkey -M vicmd 'k' history-substring-search-up +bindkey -M vicmd 'j' history-substring-search-down + # Auto-ls source ~/.config/zsh/auto-ls/auto-ls.zsh diff --git a/tasks/dotfiles.yml b/tasks/dotfiles.yml index 8ab6c30..e599385 100644 --- a/tasks/dotfiles.yml +++ b/tasks/dotfiles.yml @@ -50,6 +50,13 @@ with_items: "{{ dotusers }}" when: prompt == 'zsh' +- name: dotiles -- clone zsh zsh-history-substring-search + git: + repo: https://github.com/zsh-users/zsh-history-substring-search + dest: /home/{{ item.username }}/.config/zsh/zsh-history-substring-search + with_items: "{{ dotusers }}" + when: prompt == 'zsh' + - name: dotiles -- clone zsh auto-ls git: repo: https://github.com/desyncr/auto-ls