config/shell: adjust completions & add edcomp
This commit is contained in:
parent
d00dd95668
commit
7b4696b3a6
|
@ -32,6 +32,7 @@ yas() {
|
||||||
cmd="yay -S --nobatchinstall $pkg"
|
cmd="yay -S --nobatchinstall $pkg"
|
||||||
print -s "$cmd"
|
print -s "$cmd"
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
rehash
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
yar() {
|
yar() {
|
||||||
|
|
|
@ -78,6 +78,13 @@ edconf() {
|
||||||
|
|
||||||
CONFIG_SHELL_FUNCTIONS="${BASH_SOURCE[0]:-${(%):-%x}}"
|
CONFIG_SHELL_FUNCTIONS="${BASH_SOURCE[0]:-${(%):-%x}}"
|
||||||
alias r="reset && exec zsh"
|
alias r="reset && exec zsh"
|
||||||
|
edcomp() {
|
||||||
|
file=$(echo "$1" | sed 's/^\([^_]\)/_\1/')
|
||||||
|
$EDITOR "${fpath[-1]}/$file"
|
||||||
|
unfunction "$file" && compinit
|
||||||
|
}
|
||||||
|
compdef "_files -W ${fpath[-1]}/" edcomp
|
||||||
|
|
||||||
edshell() {
|
edshell() {
|
||||||
case $1 in
|
case $1 in
|
||||||
("") file="$CONFIG_SHELL_FUNCTIONS";;
|
("") file="$CONFIG_SHELL_FUNCTIONS";;
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
#compdef edbin
|
#compdef edbin
|
||||||
compadd $(ls -pA $HOME/.local/bin/scripts) #$(echo $PATH | cut -d':' -f1 | xargs ls -pA)
|
_files -W $HOME/.local/bin/scripts
|
||||||
|
#compadd $(ls --almost-all --indicator-style=slash $HOME/.local/bin/scripts)
|
||||||
|
#$(echo $PATH | cut -d':' -f1 | xargs ls -pA)
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#compdef yc
|
||||||
|
compadd $(git diff-index HEAD --name-only --relative=${XDG_CONFIG_HOME/$HOME\/}/)
|
||||||
|
#_files -W $XDG_CONFIG_HOME -g "git*"
|
||||||
|
# xargs _files -W $XDG_CONFIG_HOME -g
|
||||||
|
# yadm diff HEAD --name-only -- $XDG_CONFIG_HOME
|
Loading…
Reference in New Issue