From 26b9ced6354fac2f962078e4ed1a555c63cab6d1 Mon Sep 17 00:00:00 2001 From: afonso Date: Fri, 3 Jan 2025 18:31:40 +0000 Subject: [PATCH] [zsh] simple new prompt --- .config/zsh/.zshrc | 5 +---- .config/zsh/prompts/simple-two-line.zsh | 17 +++++++++++++++++ .config/zsh/themes/gruvbox_dark.zsh | 7 ------- 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 .config/zsh/prompts/simple-two-line.zsh diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 31a7b3e..34e0533 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -22,10 +22,7 @@ export READER=mupdf source $ZDOTDIR/themes/gruvbox_dark.zsh #Prompt -fpath+=$ZDOTDIR/prompts/pure -autoload -U promptinit; promptinit -export PURE_GIT_PULL=0 -prompt pure +source $ZDOTDIR/prompts/simple-two-line.zsh source $ZDOTDIR/functions.zsh source $ZDOTDIR/plugins.zsh diff --git a/.config/zsh/prompts/simple-two-line.zsh b/.config/zsh/prompts/simple-two-line.zsh new file mode 100644 index 0000000..c3e6846 --- /dev/null +++ b/.config/zsh/prompts/simple-two-line.zsh @@ -0,0 +1,17 @@ +autoload -Uz vcs_info +precmd() { + vcs_info + setopt PROMPT_SUBST + if [[ -n "$vcs_info_msg_0_" ]]; then + PROMPT='%F{blue}%~%F{yellow} (${vcs_info_msg_0_})%f'$'\n''%F{magenta}❯ ' + else + PROMPT='%F{blue}%~%f'$'\n''%F{magenta}❯ ' + fi + print -P "" +} + +zstyle ':vcs_info:*' enable git +zstyle ':vcs_info:git*' formats '%b' + +# Simple prompt initialization +autoload -U promptinit; promptinit diff --git a/.config/zsh/themes/gruvbox_dark.zsh b/.config/zsh/themes/gruvbox_dark.zsh index 549e41c..6d6c86b 100644 --- a/.config/zsh/themes/gruvbox_dark.zsh +++ b/.config/zsh/themes/gruvbox_dark.zsh @@ -75,8 +75,6 @@ ZSH_HIGHLIGHT_STYLES[cursor]='fg=#83a598' #ZSH Syntax Highlighting ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#928374,italic,underline" - - #Pure prompt # Define gruvbox dark colors pure_prompt_colors() { @@ -102,11 +100,6 @@ pure_prompt_colors() { (( $#colors )) || echo $colors } -# Apply gruvbox dark colors to Zsh Pure prompt -for color in $(pure_prompt_colors); do - zstyle ":prompt:pure:$color" color "$color" -done - # FZF # # Scheme name: Gruvbox dark, hard # Scheme system: base16