summaryrefslogtreecommitdiff
path: root/.zshrc
diff options
context:
space:
mode:
authorAndrew Guschin <guschin.drew@gmail.com>2022-02-20 10:06:42 +0400
committerAndrew Guschin <guschin.drew@gmail.com>2022-02-20 10:06:42 +0400
commite102187d33fb5ee21ca9d6d2cf50f5f2404e8050 (patch)
tree8cbc3212124049f0f8c0537c10035772ae50dc0e /.zshrc
parent19d9739151bb92ddf9af77efa7b41d16a0971ff1 (diff)
Changed zsh prompt
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc23
1 files changed, 14 insertions, 9 deletions
diff --git a/.zshrc b/.zshrc
index 152b0f1..e4f03ea 100644
--- a/.zshrc
+++ b/.zshrc
@@ -13,10 +13,7 @@ fi
alias la='ls -lhFA'
alias ll='ls -lhF'
alias l='ls -CF'
-alias dotfiles="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME'"
-alias dotstat="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' status"
-alias dotdiff="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' diff"
-alias dotadd="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' add -f"
+alias dot="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME'"
alias e="$EDITOR"
# XDG aliases
@@ -32,22 +29,30 @@ setopt extendedglob nomatch
unsetopt autocd beep
bindkey -e
autoload -Uz compinit
+zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
compinit -d $XDG_CACHE_HOME/zsh/zcompdump
+# Load version control information
+autoload -Uz vcs_info
+precmd() { vcs_info }
+
+# Format the vcs_info_msg_0_ variable
+zstyle ':vcs_info:git:*' formats ' (%b)'
+
cdf() {
cd "$(find ~ -type d &>/dev/null | fzf)"
}
-set_ps1() {
- # red color if current user us root, otherwise - green
+set_prompt() {
+ # red color if current user is root, otherwise - green
[ "$USER" = "root" ] && UCOLOR="%B%F{red}" || UCOLOR="%B%F{green}"
[ "$USER" = "root" ] && END="#" || END="$"
BLUE="%B%F{blue}"
PURPLE="%B%F{magenta}"
STOP="%f%b"
- export PS1="%T $UCOLOR%n$STOP@$PURPLE%m$STOP:$BLUE%~$STOP $END "
+ setopt PROMPT_SUBST
+ PROMPT='%T $UCOLOR%n$STOP@$PURPLE%m$STOP:$BLUE%~$STOP${vcs_info_msg_0_}'$'\n''$END '
}
-
-set_ps1
+set_prompt
fortune -s | cowsay