Skip to content

Commit

Permalink
update tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Bird committed Mar 12, 2019
1 parent 14ce685 commit c95f0b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions .davinci/rando.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,28 +240,28 @@ tab() {
local name="${@:-}"
local title

if [[ -n "${name}" ]]; then
if [[ "${name}" == "pwd" ]]; then
title="$(basename "$(pwd)")"
elif [[ -n "${name}" ]]; then
title="${name}"
elif [[ ${PWD} == ${HOME} ]]; then
title='~'
elif [[ ${PWD} == '/' ]]; then
title='/'
elif git rev-parse --git-dir > /dev/null; then
name="$(git rev-parse --show-toplevel)"
name="$(basename "${name}")"
title="${name}"
else
if git rev-parse --git-dir > /dev/null; then
name="$(git rev-parse --show-toplevel)"
name="$(basename "${name}")"
title="${name}"
else
local slash_count=$(echo -n ${PWD} | tr -d -c '/' | wc -c)
local slash_count=$(echo -n ${PWD} | tr -d -c '/' | wc -c)

if [[ ${slash_count} == 1 ]]; then
title="/${PWD##*/}"
else
# only show last dir
title="${PWD##*/}"
# show whole path plus the tilde
#title="${PWD/#$HOME/\~}"
fi
if [[ ${slash_count} == 1 ]]; then
title="/${PWD##*/}"
else
# only show last dir
title="${PWD##*/}"
# show whole path plus the tilde
#title="${PWD/#$HOME/\~}"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion .gemrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
gem: --no-ri --no-rdoc
gem: --no-document

0 comments on commit c95f0b2

Please sign in to comment.