From 52bd51d7a9d9c5123d340561cbe54e6b5c458b3f Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sat, 7 Nov 2020 01:40:04 +0800 Subject: [PATCH] [feature] allow ranger to change working directory --- fish/config/config.fish | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fish/config/config.fish b/fish/config/config.fish index c77ed8a..5412781 100644 --- a/fish/config/config.fish +++ b/fish/config/config.fish @@ -77,6 +77,19 @@ if status is-interactive end end + function ranger + set tempfile (mktemp -t tmp.XXXXXX) + command ranger --choosedir=$tempfile $argv + if test -s $tempfile + set ranger_pwd (cat $tempfile) + if test -n $ranger_pwd -a -d $ranger_pwd + builtin cd -- $ranger_pwd + end + end + + command rm -f -- $tempfile + end + append-path-if-exists ~/.yarn/bin alias k="kubectl" alias kcc="k config get-contexts"