From b59eea205cf734c9f505da38b68eb3043eedf9b5 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 20 Jun 2021 17:03:33 +0200 Subject: Add new zsh prompt --- .config/zsh/prompt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to '.config/zsh/prompt') diff --git a/.config/zsh/prompt b/.config/zsh/prompt index f0a86dc..a8a1331 100644 --- a/.config/zsh/prompt +++ b/.config/zsh/prompt @@ -29,12 +29,18 @@ zstyle ':vcs_info:git*+set-message:*' hooks git-untracked zstyle ':vcs_info:*' check-for-changes true # zstyle ':vcs_info:git:*' formats " %r/%S %b %m%u%c " -zstyle ':vcs_info:git:*' formats " %{$fg[blue]%}(%{$fg[red]%}%m%u%c%{$fg[yellow]%}%{$fg[magenta]%} %b%{$fg[blue]%})" +zstyle ':vcs_info:git:*' formats " %{$fg[red]%}%m%u%c%{$fg[yellow]%}  %{$fg[orange]%} %b" +function set-prompt() { + emulate -L zsh + local top_left='%(5~|%-1~/…/%3~|%4~)' + local top_right="\$vcs_info_msg_0_ " + local bottom_left='%B%F{%(?.green.red)}$%f%b %{$reset_color%}' + PROMPT=$top_left$top_right$'\n'$bottom_left +} + +precmd_functions+=(set-prompt) # format our main prompt for hostname current folder, and permissions. -PROMPT="%B%{$fg[blue]%}[%{$fg[white]%}%n%{$fg[red]%}@%{$fg[white]%}%m%{$fg[blue]%}] %(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )%{$fg[cyan]%}%c%{$reset_color%}" -# PROMPT="%{$fg[green]%}%n@%m %~ %{$reset_color%}%#> " -PROMPT+="\$vcs_info_msg_0_ " # TODO look into this for more colors # https://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ # also ascii escape codes -- cgit v1.2.3-70-g09d2