Explorar o código

Get the shortened path promt back

Kevin %!s(int64=6) %!d(string=hai) anos
pai
achega
1201996884
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  1. 14 0
      zshrc

+ 14 - 0
zshrc

@@ -16,6 +16,20 @@ fi
 
 ### U S E R  C O N F I G ###
 
+# Override agnosters prompt_dir
+# Using prompt_sorin's abbreviation
+prompt_dir() {
+  local pwd="${PWD/#$HOME/~}"
+
+  if [[ "$pwd" == (#m)[/~] ]]; then
+    prompt="$MATCH"
+    unset MATCH
+  else
+    prompt="${${${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}%/}//\%/%%}/${${pwd:t}//\%/%%}"
+  fi
+  prompt_segment blue $PRIMARY_FG " $prompt "
+}
+
 export PATH="$HOME/go/bin:$PATH"
 
 # random string function