From 4982d43f88ffe2746d19851d783671dd55053a8d Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Tue, 5 Dec 2017 15:38:36 -0800 Subject: [PATCH] Hack to homedir-relativize paths --- goto.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/goto.plugin.zsh b/goto.plugin.zsh index b155065..17c7c90 100644 --- a/goto.plugin.zsh +++ b/goto.plugin.zsh @@ -1,8 +1,8 @@ # goto.zsh function _awk { - which awk &>/dev/null && awk $@ || \ - which gawk &>/dev/null && gawk $@ + which awk &>/dev/null && awk $@ || \ + which gawk &>/dev/null && gawk $@ } function _gotofile { @@ -10,7 +10,7 @@ function _gotofile { } function _makeLabel { - printf "%s %s\n" $1 $2 >> `_gotofile` + printf "%s %s\n" $1 $(echo $2 | tr -d "$HOME") >> `_gotofile` } function label { @@ -35,7 +35,7 @@ function goto { then _awk "{ print \$1 }" `_gotofile` | column -t else - cd $(_awk "/^$1\s/ {print \$2;exit;}" `_gotofile`) + cd "$HOME/$(_awk "/^$1\s/ {print \$2;exit;}" `_gotofile` | head -n 1)" fi }