Browse Source

Get the shortened path promt back

Kevin 6 năm trước cách đây
mục cha
commit
1201996884
1 tập tin đã thay đổi với 14 bổ sung0 xóa
  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