mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
Async completion support
This commit is contained in:
@@ -130,6 +130,10 @@ source_first_existing() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
have_command() {
|
||||||
|
command -v "${1}" &>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
# Source extras and aliases if interactive
|
# Source extras and aliases if interactive
|
||||||
if [[ $- == *i* ]] ; then
|
if [[ $- == *i* ]] ; then
|
||||||
source_if_existing $HOME/.aliases
|
source_if_existing $HOME/.aliases
|
||||||
|
|||||||
13
dotfiles/zshrc.d/completions.zsh
Normal file
13
dotfiles/zshrc.d/completions.zsh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Build some completions if they don't exist
|
||||||
|
# We run in the background to reduce shell startup time
|
||||||
|
{
|
||||||
|
COMPDIR=${HOME}/.zshrc.completions
|
||||||
|
function missing_comp() {
|
||||||
|
test ! -f "$COMPDIR/$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
have_command rustup && {
|
||||||
|
missing_comp _rustup && rustup completions zsh > $COMPDIR/_rustup
|
||||||
|
missing_comp _cargo && rustup completions zsh cargo > $COMPDIR/_cargo
|
||||||
|
} || true
|
||||||
|
} &>/dev/null &!
|
||||||
Reference in New Issue
Block a user