From 75d7afd9ef93c71aecab080bced4a5a6011d8e9a Mon Sep 17 00:00:00 2001 From: johannst Date: Mon, 30 Mar 2020 13:14:40 +0200 Subject: zshrc: updated base16 propmpt --- zshrc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'zshrc') diff --git a/zshrc b/zshrc index 6f89a84..00b7c41 100644 --- a/zshrc +++ b/zshrc @@ -198,6 +198,11 @@ function printBase16() { done } +# https://github.com/ohmyzsh/ohmyzsh/issues/5068 +function shpwd() { + echo ${${:-/${(j:/:)${(M)${(s:/:)${(D)PWD:h}}#(|.)[^.]}}/${PWD:t}}//\/~/\~} +} + function _installMyPrompt() { function zle-line-init zle-keymap-select { vinorm='n' @@ -217,8 +222,7 @@ function _installMyPromptBase16() { vinorm='n' viins='i' c_del='%F{7}' - c_usr='%F{6}' - c_hos='%F{5}' + c_usr='%F{2}' c_tty='%F{8}' c_dir='%F{14}' c_dir2='%F{242}' @@ -236,7 +240,7 @@ function _installMyPromptBase16() { GIT_PROMPT_AHEAD="${c_del}:${c_git_ahead}↑" GIT_PROMPT_SUFFIX="${c_del})$color[noColor] " - PS1="$c_usr%n$c_del::$c_hos%m$c_del:$c_dir%2~$color[noColor] [$vimode] $(git_info)$c_ret%(?..%? )$c_del$color[noColor]> " + PS1="$c_usr%n@%m:$c_dir$(shpwd)$color[noColor] ::<$vimode> $(git_info)$c_ret%(?..%? )$c_del$color[noColor]> " RPS1="%F$c_dir2%~$color[noColor]" zle reset-prompt } -- cgit v1.2.3