From 220886b4615fdd84eecacb1e6805598c5adbfc0b Mon Sep 17 00:00:00 2001 From: Von Random Date: Mon, 6 May 2024 16:53:16 +0300 Subject: [PATCH] zsh: some functions and completion --- cli/.config/zsh/prompt.zsh | 5 +++++ cli/.config/zsh/settings.zsh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/.config/zsh/prompt.zsh b/cli/.config/zsh/prompt.zsh index 89ccb09..9dc9c14 100644 --- a/cli/.config/zsh/prompt.zsh +++ b/cli/.config/zsh/prompt.zsh @@ -31,6 +31,11 @@ typeset -A prompt_colors=( bang '8' ) +prompt.set_bang() { + (( $# )) || return 1 + prompt_symbols[bang]=$1 +} + precmd.is_git_repo() { typeset prompt_git_dir prompt_git_dir=$(git rev-parse --git-dir 2>/dev/null) || return 1 diff --git a/cli/.config/zsh/settings.zsh b/cli/.config/zsh/settings.zsh index e12d6ac..b8ab5da 100644 --- a/cli/.config/zsh/settings.zsh +++ b/cli/.config/zsh/settings.zsh @@ -34,7 +34,7 @@ zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character zstyle ':completion:*' list-suffixes true zstyle ':completion:*' original true zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' -zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' +zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+l:|=* r:|=*' zstyle ':completion:*' rehash true zstyle ':completion:*:kill:*:processes' command 'ps --forest -A -o pid,user,cmd' zstyle ':completion:*:processes-names' command 'ps axho command'