Add utility to generate shell completions
This commit is contained in:
parent
0fb069f4bc
commit
1ffce9ed20
4 changed files with 137 additions and 0 deletions
6
.zshrc
6
.zshrc
|
|
@ -63,12 +63,18 @@ stty -ixon # Prevent <Control>s from freezing `zsh`
|
|||
|
||||
# Enable (tab) completions
|
||||
|
||||
# Look for completion files generated by ~/.local/bin/generate-shell-completions
|
||||
fpath=("${XDG_DATA_HOME:-$HOME/.local/share}/zsh/completions" $fpath)
|
||||
|
||||
# "-u" disables the ownership check on completion dirs, which is safe since only we write to them
|
||||
autoload -Uz compinit && compinit -u -d "${XDG_STATE_HOME:-$HOME/.local/state}/zsh/zcompdump"
|
||||
|
||||
# Complete the `--force` flag of the `dotfiles` utilities in ~/.local/bin
|
||||
compdef '_arguments "--force[skip safety checks / reinstall]"' dotfiles-install dotfiles-update
|
||||
|
||||
# Complete the `--quieter` flag of the `generate-shell-completions` utility in ~/.local/bin
|
||||
compdef '_arguments "--quieter[suppress the reload hint]"' generate-shell-completions
|
||||
|
||||
# Enable match highlighting and scrolling through long lists,
|
||||
# and provide a different style of menu completion
|
||||
zmodload zsh/complist
|
||||
|
|
|
|||
Loading…
Reference in a new issue