From 67bc1a27b15674719cdf183d4173c16ba7e5c3d0 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 27 May 2024 01:48:03 -0700 Subject: fix: make fzf ctrl-t work in symlink dir --- home/xyz/.profile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'home/xyz/.profile') diff --git a/home/xyz/.profile b/home/xyz/.profile index cc5b43b1..4add2fce 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -63,7 +63,10 @@ export XMODIFIERS=@im=fcitx 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" -- cgit v1.2.3-70-g09d2