diff options
Diffstat (limited to 'config/essentials')
-rw-r--r-- | config/essentials/shell/aliases.sh | 1 | ||||
-rw-r--r-- | config/essentials/shell/functions.sh | 11 | ||||
-rw-r--r-- | config/essentials/starship.toml | 4 | ||||
-rw-r--r-- | config/essentials/zsh/.zshrc | 7 |
4 files changed, 20 insertions, 3 deletions
diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index d5f3e7f..6305a90 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -333,3 +333,4 @@ alias update-mirrors='reflector -p https | rankmirrors -n 10 -p -w - | doas tee alias tmpd='cd $(mktemp -d)' alias brs='$BROWSER' + diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index 8172c73..1fd6e92 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -332,3 +332,14 @@ serve() { } ssh_keyadd() { ssh-keygen -f "$HOME"/.ssh/"$1" -P "$(pass generate -f keys/"$HOST"/ssh/"$1" | tail -n 1)" -t ed25519; } + + +fchange() +{ + [ "$1" ] || return 1 + inotifywait -m -e create,modify,delete --format "%f" "${2:-.}" | + while read -r EVENT + do + eval "$1" + done +} diff --git a/config/essentials/starship.toml b/config/essentials/starship.toml index cd5832f..15139f5 100644 --- a/config/essentials/starship.toml +++ b/config/essentials/starship.toml @@ -34,8 +34,6 @@ disabled = false [custom.upds] command = 'cat ~/.cache/updates' # shows output of command -# detect_files = ['foo'] # can specify filters but wildcards are not supported -when = ''' test "$(cat ~/.cache/updates)" -gt 0''' +when = '[ "$(cat ~/.cache/updates)" -gt 0 ]' symbol = '📦' format = '$output$symbol ' - diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index c9bf8b1..ab66fcb 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -110,6 +110,13 @@ bindkey -M menuselect '^xh' accept-and-hold # Hold bindkey -M menuselect '^xn' accept-and-infer-next-history # Next bindkey -M menuselect '^xu' undo # Undo +space-expand-alias() { + zle _expand_alias + zle self-insert +} +zle -N space-expand-alias +bindkey -M main ' ' space-expand-alias + ## window title hooks add-zsh-hook -Uz preexec () { print -n "\e]0;$1\a\033[0m"; } add-zsh-hook -Uz precmd set_wt (){ print -Pn "\e]0;%n@%m on %~\a"; } |