mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Remove whitespace
This commit is contained in:
parent
447290938a
commit
f9ae1eb72e
1 changed files with 3 additions and 4 deletions
|
|
@ -4,12 +4,12 @@
|
||||||
function collapse_pwd {
|
function collapse_pwd {
|
||||||
local pwd_truncation_length=20
|
local pwd_truncation_length=20
|
||||||
local dir=$(pwd)
|
local dir=$(pwd)
|
||||||
|
|
||||||
if $(echo $dir | grep "^$HOME" >>/dev/null)
|
if $(echo $dir | grep "^$HOME" >>/dev/null)
|
||||||
then
|
then
|
||||||
dir="~$(echo $dir | awk -F$HOME '{print $2}')"
|
dir="~$(echo $dir | awk -F$HOME '{print $2}')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(echo -n $dir | wc -c | tr -d " ") -gt $pwd_truncation_length ]
|
if [ $(echo -n $dir | wc -c | tr -d " ") -gt $pwd_truncation_length ]
|
||||||
then
|
then
|
||||||
dir="…${dir[-$pwd_truncation_length,-1]}"
|
dir="…${dir[-$pwd_truncation_length,-1]}"
|
||||||
|
|
@ -29,7 +29,7 @@ function git_remote_information {
|
||||||
local n_commits="$(egrep -o "by [0-9]+ commit" <<< $git_status | awk '{ print $2 }')"
|
local n_commits="$(egrep -o "by [0-9]+ commit" <<< $git_status | awk '{ print $2 }')"
|
||||||
remote_information=" ahead($n_commits)"
|
remote_information=" ahead($n_commits)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -q "have diverged" <<< $git_status ; then
|
if grep -q "have diverged" <<< $git_status ; then
|
||||||
local n_commits="$(egrep -o "have [0-9]+ and [0-9]+ different commit" <<< $git_status | awk '{ print $2,$4 }')"
|
local n_commits="$(egrep -o "have [0-9]+ and [0-9]+ different commit" <<< $git_status | awk '{ print $2,$4 }')"
|
||||||
remote_information=" diverged($n_commits)"
|
remote_information=" diverged($n_commits)"
|
||||||
|
|
@ -62,4 +62,3 @@ ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
|
||||||
|
|
||||||
PROMPT="${pwd} ➤ "
|
PROMPT="${pwd} ➤ "
|
||||||
RPROMPT="${return_code} ${git_information}"
|
RPROMPT="${return_code} ${git_information}"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue