🔧 Massive update to personal gentoo configs
This commit is contained in:
parent
505f6363ab
commit
6686861b86
497 changed files with 29421 additions and 7191 deletions
4
gentoo/dotfiles/.zsh/zsh-autocomplete/Tests/__init__.zsh
Normal file
4
gentoo/dotfiles/.zsh/zsh-autocomplete/Tests/__init__.zsh
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
setopt localoptions extendedglob clobber NO_aliases localloops pipefail NO_shortloops NO_unset
|
||||
zmodload zsh/param/private
|
||||
autoload -Uz zmathfunc && zmathfunc
|
||||
builtin autoload -UWz $PWD/{Completions,Functions}/**/[_.]autocomplete(__|:)*~*.zwc(DN-.:P)
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
Setup:
|
||||
```zsh
|
||||
% source Tests/__init__.zsh
|
||||
% typeset -gA compstate=() _lastcomp=()
|
||||
% typeset -ga comptags=()
|
||||
% typeset -g curcontext=
|
||||
% zstyle ':autocomplete:*' add-space 'FOO' 'BAR'
|
||||
% zstyle ':autocomplete:*' insert-unambiguous yes
|
||||
%
|
||||
```
|
||||
|
||||
If there is a common substring, insert it (if enabled).
|
||||
```zsh
|
||||
% compstate[old_list]=keep _lastcomp[tags]=
|
||||
% compstate[nmatches]=0 _lastcomp[nmatches]=1
|
||||
% WIDGETSTYLE= WIDGET=
|
||||
% _autocomplete__unambiguous=FOO
|
||||
% .autocomplete__complete-word__post
|
||||
% print -r -- ${(q+)compstate[insert]} $+MENUSELECT $MENUMODE
|
||||
unambiguous 0
|
||||
%
|
||||
```
|
||||
|
||||
When using a menu widget, add automenu.
|
||||
```zsh
|
||||
% compstate[old_list]=keep _lastcomp[tags]=
|
||||
% compstate[nmatches]=0 _lastcomp[nmatches]=1
|
||||
% WIDGETSTYLE=menu-select WIDGET=
|
||||
% _autocomplete__unambiguous=FOO
|
||||
% .autocomplete__complete-word__post
|
||||
% print -r -- ${(q+)compstate[insert]} $+MENUSELECT $MENUMODE
|
||||
automenu-unambiguous 0
|
||||
%
|
||||
```
|
||||
|
||||
Default inserts first match.
|
||||
```zsh
|
||||
% compstate[old_list]=keep _lastcomp[tags]=
|
||||
% compstate[nmatches]=0 _lastcomp[nmatches]=2
|
||||
% WIDGETSTYLE= WIDGET=
|
||||
% _autocomplete__unambiguous=
|
||||
% .autocomplete__complete-word__post
|
||||
% print -r -- ${(q+)compstate[insert]}
|
||||
1
|
||||
%
|
||||
```
|
||||
|
||||
Add a space for certain tags.
|
||||
```zsh
|
||||
% compstate[old_list]=keep _lastcomp[tags]='BAR BAZ'
|
||||
% compstate[nmatches]=0 _lastcomp[nmatches]=1
|
||||
% WIDGETSTYLE= WIDGET=
|
||||
% _autocomplete__unambiguous=
|
||||
% comptags=( BAR ) .autocomplete__complete-word__post
|
||||
% print -r -- ${(q+)compstate[insert]}
|
||||
'1 '
|
||||
%
|
||||
```
|
||||
|
||||
`menu-` widgets insert `menu:`.
|
||||
```zsh
|
||||
% compstate[old_list]=keep _lastcomp[tags]='BAR BAZ'
|
||||
% compstate[nmatches]=0 _lastcomp[nmatches]=2
|
||||
% WIDGETSTYLE=menu-complete WIDGET=
|
||||
% _autocomplete__unambiguous=
|
||||
% .autocomplete__complete-word__post
|
||||
% print -r -- ${(q+)compstate[insert]} $+MENUSELECT $MENUMODE
|
||||
'menu:1 ' 0
|
||||
%
|
||||
```
|
||||
|
||||
`menu-select` widgets add `MENUSELECT`
|
||||
```zsh
|
||||
% compstate[old_list]=keep _lastcomp[tags]='BAR BAZ'
|
||||
% compstate[nmatches]=0 _lastcomp[nmatches]=2
|
||||
% WIDGETSTYLE=menu-select WIDGET=
|
||||
% _autocomplete__unambiguous=
|
||||
% .autocomplete__complete-word__post
|
||||
% print -r -- ${(q+)compstate[insert]} $+MENUSELECT $MENUMODE
|
||||
'menu:1 ' 1
|
||||
%
|
||||
```
|
||||
|
||||
`menu-select` widgets with `search` in name add `MENUMODE=search-forward`.
|
||||
```zsh
|
||||
% compstate[old_list]=keep _lastcomp[tags]='BAR BAZ'
|
||||
% compstate[nmatches]=0 _lastcomp[nmatches]=2
|
||||
% WIDGETSTYLE=menu-select WIDGET=incremental-history-search-forward
|
||||
% _autocomplete__unambiguous=
|
||||
% .autocomplete__complete-word__post
|
||||
% print -r -- ${(q+)compstate[insert]} $+MENUSELECT $MENUMODE
|
||||
'menu:1 ' 1 search-forward
|
||||
%
|
||||
```
|
||||
|
||||
Reverse inserts the last match.
|
||||
```zsh
|
||||
% compstate[old_list]=keep _lastcomp[tags]='BAR BAZ'
|
||||
% compstate[nmatches]=0 _lastcomp[nmatches]=2
|
||||
% WIDGETSTYLE=reverse-menu-complete WIDGET=
|
||||
% _autocomplete__unambiguous=
|
||||
% .autocomplete__complete-word__post
|
||||
% print -r -- ${(q+)compstate[insert]}
|
||||
'menu:0 '
|
||||
%
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue