From fed0fd249ef9d2c2a21bb5dfb98ce53b12040354 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 7 Nov 2023 22:38:02 +0100 Subject: added completion system configuration --- config/essentials/zsh/.zshrc | 52 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 76ff87f..45f98e4 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -15,13 +15,61 @@ autoload -U select-word-style autoload -z edit-command-line zle -N edit-command-line zstyle ':compinstall' filename '/home/aluc/.zshrc' + +### Completion +# cache +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path "$ZDOTDIR/zcompcache" + +# completers +zstyle ':completion:*' completer _extensions _complete _approximate + +# format +zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- (%e) -!%f' +zstyle ':completion:*:*:*:*:descriptions' format '%F{blue}-- %D%d --%f' +zstyle ':completion:*:*:*:*:messages' format '%F{purple}-- %d --%f' +zstyle ':completion:*:*:*:*:warnings' format '%F{red}-- no matches found --%f' +zstyle ':completion:*:default' list-prompt '%S%M matches%s' +# show a 'ls -a' like outptut when listing files +zstyle ':completion:*' file-list all +zstyle ':completion:*:*:*:*:default' list-colors ${(s.:.)LS_COLORS} + +# Group completions by categories +zstyle ':completion:*' group-name '' +zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands + +zstyle ':completion:*' squeeze-slashes true + +# Prefer completing for an option (think cd -) +zstyle ':completion:*' complete-options true + +# See ZSHCOMPWID "completion matching control" +zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +# keep prefix when completing +zstyle ':completion:*' keep-prefix true + +# ui zstyle ':completion:*' menu select -autoload -Uz compinit +# Move around using h j k l in completion menu +zmodload zsh/complist +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'j' vi-down-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect '^xg' clear-screen +# interactive mode +bindkey -M menuselect '^xi' vi-insert +bindkey -M menuselect '^xh' accept-and-hold # Hold +bindkey -M menuselect '^xn' accept-and-infer-next-history # Next +bindkey -M menuselect '^xu' undo # Undo + +autoload -Uz compinit; compinit + autoload -Uz surround zle -N delete-surround surround zle -N add-surround surround zle -N change-surround surround -compinit # Source files . $ZDOTDIR/functions.zsh -- cgit v1.2.3 From 020cd46cb03e5d7f0bee8cedc6ce0b666aaebe3e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 10 Nov 2023 00:45:19 +0100 Subject: removed approxiamte completer --- config/essentials/zsh/.zshrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 45f98e4..74bab34 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -22,10 +22,9 @@ zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path "$ZDOTDIR/zcompcache" # completers -zstyle ':completion:*' completer _extensions _complete _approximate +zstyle ':completion:*' completer _extensions _complete # format -zstyle ':completion:*:*:*:*:corrections' format '%F{yellow}!- (%e) -!%f' zstyle ':completion:*:*:*:*:descriptions' format '%F{blue}-- %D%d --%f' zstyle ':completion:*:*:*:*:messages' format '%F{purple}-- %d --%f' zstyle ':completion:*:*:*:*:warnings' format '%F{red}-- no matches found --%f' -- cgit v1.2.3 From f1bb5ec20fcc323ec50eff2d726c5027e18589f6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 10 Nov 2023 11:37:58 +0100 Subject: removed completion matching control --- config/essentials/zsh/.zshrc | 3 --- 1 file changed, 3 deletions(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 74bab34..db93ac9 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -42,9 +42,6 @@ zstyle ':completion:*' squeeze-slashes true # Prefer completing for an option (think cd -) zstyle ':completion:*' complete-options true -# See ZSHCOMPWID "completion matching control" -zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - # keep prefix when completing zstyle ':completion:*' keep-prefix true -- cgit v1.2.3 From 3f704ee3e28f1448bc344400c2c6082157e7ee42 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 12 Nov 2023 17:21:33 +0100 Subject: remove file list all on completion --- config/essentials/zsh/.zshrc | 1 - 1 file changed, 1 deletion(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index db93ac9..1de3e91 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -30,7 +30,6 @@ zstyle ':completion:*:*:*:*:messages' format '%F{purple}-- %d --%f' zstyle ':completion:*:*:*:*:warnings' format '%F{red}-- no matches found --%f' zstyle ':completion:*:default' list-prompt '%S%M matches%s' # show a 'ls -a' like outptut when listing files -zstyle ':completion:*' file-list all zstyle ':completion:*:*:*:*:default' list-colors ${(s.:.)LS_COLORS} # Group completions by categories -- cgit v1.2.3 From 5c6e9b64eef36b98f05b85673089c6d8ef6b140d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 14 Nov 2023 12:47:39 +0100 Subject: won two characters of screen! --- config/essentials/zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 1de3e91..c590d54 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -153,7 +153,7 @@ command_not_found_handler () { } # prompt -PS1=' %B%(#.%F{1}.%F{13})[%n%b%f@%B%F{6}%m]%b%f %3~ ' +PS1=' %B%(#.%F{1}.%F{13})%n%b%f@%B%F{6}%m%b%f %3~ ' RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(parse_git_branch)%f%(?.. %?)' setopt prompt_subst -- cgit v1.2.3