commit 5c2dbb527c95c2a028d49f6e170f4c919b24337a parent fa252cbdb6201e3d25186881ce3e6acc133e39c9 Author: tongong <tongong@gmx.net> Date: Tue, 15 Jun 2021 20:04:04 +0200 fcd now cd's to edited file Diffstat:
M | scripts/fcd | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/fcd b/scripts/fcd @@ -11,7 +11,7 @@ chosen="$( (echo exit; cat "$INDEXFILE") | fzf --layout=reverse --height=40% \ | sed -E "s/^~/\/home\/$(whoami)/")" [ -d "$chosen" ] && cd "$chosen" -[ -f "$chosen" ] && nvim "$chosen" +[ -f "$chosen" ] && cd "$(dirname $chosen)" && nvim "$chosen" unset INDEXFILE unset chosen