Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Source prompt_pwd shorten function from @bjeanes.

  • Loading branch information...
commit dd0fae93bbc36132fc61ad3c407784be3b3d606b 1 parent ec56a4e
Odin Dutton authored

Showing 2 changed files with 1 addition and 24 deletions. Show diff stats Hide diff stats

  1. +1 0  freshrc
  2. +0 24 zsh/prompt.zsh
1  freshrc
@@ -15,6 +15,7 @@ fresh henrik/dotfiles rubyrc --file=~/.pryrc --filter='cat; echo include RubyRC'
15 15 # Zsh
16 16 fresh-options --file=~/.zshrc --marker
17 17 fresh zsh/completion.zsh
  18 + fresh bjeanes/dot-files shells/zsh/lib/prompt.zsh --ref=f48931f --filter='sed -n 28,53p'
18 19 fresh zsh/prompt.zsh
19 20 fresh zsh/title.zsh
20 21 fresh zsh/aliases.zsh
24 zsh/prompt.zsh
@@ -32,30 +32,6 @@ git_stash() {
32 32 git stash list 2> /dev/null | wc -l | sed -e "s/ *\([0-9]*\)/\ \+\1/g" | sed -e "s/ \+0//"
33 33 }
34 34
35   -# http://github.com/bjeanes/dot-files/blob/master/shell/prompt.sh
36   -prompt_pwd() {
37   - local repo="$vcs_info_msg_1_"
38   -
39   - parts=(${(s:/:)${${PWD}/#${HOME}/\~}})
40   -
41   - i=0
42   - while (( i++ < ${#parts} )); do
43   - part="$parts[i]"
44   - if [[ "$part" == "$repo" ]]; then
45   - # if this part of the path represents the repo,
46   - # underline it, and skip truncating the component
47   - parts[i]="%U$part%u"
48   - else
49   - # shorten the path as long as it isn't the last piece
50   - if [[ "$parts[${#parts}]" != "$part" ]]; then
51   - parts[i]="$part[1,1]"
52   - fi
53   - fi
54   - done
55   -
56   - echo "${(j:/:)parts}"
57   -}
58   -
59 35 local git_formats="%{${fg_bold[yellow]}%}± %b%c%u:%.7i%{${reset_color}%}"
60 36 zstyle ':vcs_info:git*' enable git
61 37 zstyle ':vcs_info:git*' check-for-changes true

0 comments on commit dd0fae9

Please sign in to comment.
Something went wrong with that request. Please try again.