From ac96c924ae68840a38139c14d68de6775144cde4 Mon Sep 17 00:00:00 2001 From: awy Date: Tue, 29 Oct 2024 21:59:47 +0300 Subject: zsh git integration --- .config/zsh/.zshrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to '.config') diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index a2c2dfe..cbe7383 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -1,7 +1,14 @@ # Enable colors and change prompt: autoload -U colors && colors # Load colors -PS1="%{$fg[green]%}%n%{$reset_color%}@%M %{$fg[green]%}%~%{$reset_color%}> " +autoload -Uz vcs_info +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) +zstyle ':vcs_info:git:*' formats "[%b]%{$fg[yellow]%}%u" +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' unstagedstr '*' +setopt PROMPT_SUBST +PROMPT='%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$fg[red]%}${vcs_info_msg_0_}%{$reset_color%}$%b ' setopt autocd # Automatically cd into typed directory. stty stop undef # Disable ctrl-s to freeze terminal. setopt interactive_comments -- cgit v1.2.3