From ce43ea9f4273ef2b4c67cb02dc55ed883f6c0fd9 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 16 Feb 2017 09:18:01 +0100 Subject: [shell] Replace `sed` with `-mindepth 1` and `cut` (#844) --- 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 69dd0ce4..b1505334 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -46,8 +46,8 @@ fzf-file-widget() { __fzf_cd__() { local cmd dir - cmd="${FZF_ALT_C_COMMAND:-"command find -L . \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ - -o -type d -print 2> /dev/null | sed 1d | cut -b3-"}" + cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + -o -type d -print 2> /dev/null | cut -b3-"}" dir=$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m) && printf 'cd %q' "$dir" } -- cgit v1.2.3