summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2024-05-27 01:48:03 -0700
committerXiao Pan <gky44px1999@gmail.com>2024-06-01 14:59:58 -0700
commitbca2c3a590f61f421bf8cac73b7083da32e35c3e (patch)
tree41cd60f17ad88ae8254eb22a95a0b374c1c96df6 /home
parentedb43020d88bf962630930a21f60841ded54ebd9 (diff)
fix: make fzf ctrl-t work in symlink dir
Diffstat (limited to 'home')
-rw-r--r--home/xyz/.profile5
1 files changed, 4 insertions, 1 deletions
diff --git a/home/xyz/.profile b/home/xyz/.profile
index d0f5e5f0..37bd162f 100644
--- a/home/xyz/.profile
+++ b/home/xyz/.profile
@@ -52,7 +52,10 @@ export MAKEFLAGS="-j$(nproc --all)"
export FZF_DEFAULT_COMMAND="find . -mindepth 1 -path '*/\.git' -prune -o -print"
# https://askubuntu.com/questions/444551/get-absolute-path-of-files-using-find-command
# following two lines if use "" on the outermost, will not perfom expected, not sure why
-export FZF_CTRL_T_COMMAND='find "$PWD" -mindepth 1 -path "*/\.git" -prune -o -print'
+# use "$(pwd -P)" instead of "$PWD", else it will not work in symlink dir
+# -P to make it show realpath, another way is: "$(realpath .)", but I prefer pwd because it is shell builtin which maybe faster
+# or I can use find -L or -H (not sure about differences between the two), but I prefer realpath instead of symlink
+export FZF_CTRL_T_COMMAND='find "$(pwd -P)" -mindepth 1 -path "*/\.git" -prune -o -print'
#export FZF_CTRL_T_COMMAND='sudo find "$(pwd)" -path "*/\.git" -prune -o -print'
# ~+ is bashism
#export FZF_CTRL_T_COMMAND="sudo find ~+ -path '*/\.git' -prune -o -print"