Zsh completion configuration: Difference between revisions

From wikinotes
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Documentation =
<blockquote>
{| class="wikitable"
|-
| completion system configuration || https://man.archlinux.org/man/extra/zsh/zshall.1.en#COMPLETION_SYSTEM_CONFIGURATION
|-
| format string types || https://man.archlinux.org/man/extra/zsh/zshall.1.en#SIMPLE_PROMPT_ESCAPES
|-
|}
</blockquote><!-- Documentation -->
= Tutorials =
<blockquote>
{| class="wikitable"
|-
| completion formatting tut || https://thevaluable.dev/zsh-completion-guide-examples/
|-
|}
</blockquote><!-- Tutorials -->
= Loading Completions =
= Loading Completions =
<blockquote>
<blockquote>

Latest revision as of 23:57, 28 December 2021

Documentation

completion system configuration https://man.archlinux.org/man/extra/zsh/zshall.1.en#COMPLETION_SYSTEM_CONFIGURATION
format string types https://man.archlinux.org/man/extra/zsh/zshall.1.en#SIMPLE_PROMPT_ESCAPES

Tutorials

completion formatting tut https://thevaluable.dev/zsh-completion-guide-examples/

Loading Completions

fpath=(~/.zsh/completion $fpath) # add completion dir to $fpath
autoload -U compinit             # init autocompletion
compinit

The cleanest way to reload your autocompletion script is:

  • open a new terminal
  • autoload -U ~/.zsh/completion/_yourcompleter:t

Customizing Completion Display

zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f'

colours

%F{green}...%f: fg colour
%K{green}...%f: bg colour
%B...%b:        bold
%U...%u:        underline
%d: description
%f: