🔧 Massive update to personal gentoo configs
This commit is contained in:
parent
505f6363ab
commit
6686861b86
497 changed files with 29421 additions and 7191 deletions
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/zsh
|
||||
setopt localoptions banghist
|
||||
zmodload -F zsh/terminfo p:terminfo
|
||||
|
||||
local context=${curcontext:-${WIDGET}:::}
|
||||
unset curcontext
|
||||
local +h curcontext=$context
|
||||
|
||||
local +h -a comppostfuncs=( .autocomplete__complete-word__post "$comppostfuncs[@]" )
|
||||
|
||||
if [[ -z $compstate[old_list] && $curcontext == history-incremental-search* ]]; then
|
||||
autocomplete:_main_complete:new - history-lines _autocomplete__history_lines
|
||||
elif [[ -z $compstate[old_list] && $curcontext == recent-paths:* ]]; then
|
||||
autocomplete:_main_complete:new - recent-paths _autocomplete__recent_paths
|
||||
elif [[ -z $compstate[old_list] ]] ||
|
||||
[[ -v _autocomplete__partial_list && $WIDGETSTYLE == (|*-)(list|menu)(|-*) ]] ||
|
||||
_autocomplete__should_insert_unambiguous; then
|
||||
compstate[old_list]=
|
||||
autocomplete:_main_complete:new
|
||||
else
|
||||
compstate[old_list]=keep
|
||||
autocomplete:_main_complete:new -
|
||||
fi
|
||||
|
||||
[[ $_lastcomp[nmatches] -gt 0 && -n $compstate[insert] ]]
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
#autoload
|
||||
|
||||
local -a match=() mbegin=() mend=() # `zstyle` for some reason assigns these.
|
||||
|
||||
unset MENUMODE MENUSELECT
|
||||
|
||||
if [[ $WIDGETSTYLE != (|*-)menu(|-*) ]]; then
|
||||
compstate[list]=
|
||||
zle -Rc
|
||||
fi
|
||||
|
||||
if [[ $_completer == _prefix ]]; then
|
||||
compstate[to_end]=
|
||||
else
|
||||
compstate[to_end]='always'
|
||||
fi
|
||||
|
||||
{
|
||||
compstate[insert]=
|
||||
|
||||
if _autocomplete__should_insert_unambiguous; then
|
||||
if [[ $WIDGETSTYLE == (|*-)menu(|-*) ]]; then
|
||||
compstate[insert]='automenu-'
|
||||
fi
|
||||
compstate[insert]+='unambiguous'
|
||||
unset _autocomplete__unambiguous
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ $WIDGETSTYLE == (|*-)menu(|-*) ]]; then
|
||||
if [[ $WIDGETSTYLE == (|*-)select(|-*) ]]; then
|
||||
typeset -gi MENUSELECT=0
|
||||
if [[ $WIDGET == (|*-)search(|-*) ]]; then
|
||||
typeset -g MENUMODE=search-forward
|
||||
fi
|
||||
fi
|
||||
compstate[insert]='menu:'
|
||||
fi
|
||||
if [[ $WIDGET == (|.)reverse-* || $WIDGETSTYLE == (|.)reverse-menu-complete ]]; then
|
||||
compstate[insert]+='0'
|
||||
else
|
||||
compstate[insert]+='1'
|
||||
fi
|
||||
|
||||
local -Pa comptags=()
|
||||
if [[ $compstate[old_list] == keep ]]; then
|
||||
comptags=( $=_lastcomp[tags] )
|
||||
else
|
||||
comptags=( $=_comp_tags )
|
||||
fi
|
||||
|
||||
local -a spacetags=()
|
||||
builtin zstyle -a ":autocomplete:$WIDGET:" add-space spacetags ||
|
||||
spacetags=( executables aliases functions builtins reserved-words commands )
|
||||
|
||||
[[ -n ${comptags:*spacetags} ]] &&
|
||||
compstate[insert]+=' '
|
||||
|
||||
} always {
|
||||
unset _autocomplete__inserted
|
||||
[[ -n $compstate[insert] ]] &&
|
||||
typeset -g _autocomplete__inserted
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/zsh
|
||||
|
||||
if [[ $RBUFFER == *$'\n'* ]]; then
|
||||
builtin zle down-line
|
||||
else
|
||||
builtin zle menu-select -w
|
||||
fi
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/zsh
|
||||
local 0=${(%):-%N}
|
||||
|
||||
${0}() {
|
||||
typeset -g curcontext=${WIDGET}:::
|
||||
local +h -a comppostfuncs=( ${(%):-%N}:post "$comppostfuncs[@]" )
|
||||
compstate[old_list]=
|
||||
autocomplete:_main_complete:new - history-lines _autocomplete__history_lines
|
||||
|
||||
unset curcontext
|
||||
(( _lastcomp[nmatches] ))
|
||||
}
|
||||
|
||||
${0}:post() {
|
||||
typeset -gi MENUSELECT=0
|
||||
compstate[insert]='menu:0'
|
||||
if (( compstate[nmatches] < 2 )); then
|
||||
compstate[list]=
|
||||
fi
|
||||
}
|
||||
|
||||
${0} "$@"
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/zsh
|
||||
|
||||
if [[ $LBUFFER == *$'\n'* ]]; then
|
||||
builtin zle up-line
|
||||
else
|
||||
builtin zle history-search-backward -w
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue