From 8eec50d764878628236566e0ef9767688b6de8d0 Mon Sep 17 00:00:00 2001 From: Christoph Anton Mitterer Date: Sun, 24 Sep 2023 00:04:28 +0200 Subject: =?UTF-8?q?[shell]=20don=E2=80=99t=20needlessly=20escape=20`.`=20i?= =?UTF-8?q?n=20shell=20pattern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `find`’s `-path`-option is described to use shell patterns (i.e. POSIX’ pattern matching notation). In that, `.` is not a special character, thus escaping it shouldn’t be necessary. Signed-off-by: Christoph Anton Mitterer --- shell/key-bindings.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell/key-bindings.bash') diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index aa0b8ace..a0d0bdad 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -15,7 +15,7 @@ # ------------ __fzf_select__() { local cmd opts - cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ -o -type f -print \ -o -type d -print \ -o -type l -print 2> /dev/null | cut -b3-"}" @@ -42,7 +42,7 @@ fzf-file-widget() { __fzf_cd__() { local cmd opts dir - cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ -o -type d -print 2> /dev/null | cut -b3-"}" opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse --scheme=path ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m" dir=$(set +o pipefail; eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)) && printf 'builtin cd -- %q' "$dir" -- cgit v1.2.3