diff --git a/config/basic/home-manager.nix b/config/basic/home-manager.nix index 6ab0f42..13a81a0 100644 --- a/config/basic/home-manager.nix +++ b/config/basic/home-manager.nix @@ -35,4 +35,8 @@ # This overrides compdump each time, in turn making startup very slow enableCompletion = false; }; + + # But still link all completions from all packages so they + # can be found by zsh + environment.pathsToLink = ["/share/zsh"]; } diff --git a/users/common/shells/zsh/zshrc b/users/common/shells/zsh/zshrc index 6c7db57..80e5479 100644 --- a/users/common/shells/zsh/zshrc +++ b/users/common/shells/zsh/zshrc @@ -1,51 +1,24 @@ # Don't insert tabs when there is no completion (e.g. beginning of line) zstyle ':completion:*' insert-tab false -# match uppercase from lowercase -zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' - -# separate matches into groups -zstyle ':completion:*:matches' group 'yes' -zstyle ':completion:*' group-name '' - -zstyle ':completion:*:messages' format '%d' -zstyle ':completion:*:options' auto-description '%d' - -# describe options in full -zstyle ':completion:*:options' description 'yes' - -# on processes completion complete all user processes -zstyle ':completion:*:processes' command 'ps -au$USER' # provide verbose completion information zstyle ':completion:*' verbose true -# Ignore completion functions for commands you don't have: -zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*' - -# Provide more processes in completion of programs like killall: -zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq' - -# complete manual by their section -zstyle ':completion:*:manuals' separate-sections true -zstyle ':completion:*:manuals.*' insert-sections true -zstyle ':completion:*:man:*' menu yes select - -# provide .. as a completion -zstyle ':completion:*' special-dirs .. - -# No correction -zstyle ':completion:*' completer _oldlist _expand _complete _files _ignored - # treat multiple slash as one zstyle ':completion:*' squeeze-slashes true +# start menu completion also if it could find unambiguous initial string +zstyle ':completion:*' insert-unambiguous false + # disable sort when completing `git checkout` zstyle ':completion:*:git-checkout:*' sort false # set descriptions format to enable group support zstyle ':completion:*:descriptions' format '[%d]' # set list-colors to enable filename colorizing zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +# force zsh to show completion menu, so common prefixes are not expanded first +zstyle ':completion:*' menu yes # preview directory's content with ls when completing cd zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls -lhF --group-directories-first --show-control-chars --quoting-style=escape --color=auto $realpath'; # preview windown min size