summaryrefslogtreecommitdiffstats
path: root/shell/key-bindings.bash
diff options
context:
space:
mode:
authorPierre Neidhardt <ambrevar@gmail.com>2017-02-16 09:18:01 +0100
committerJunegunn Choi <junegunn.c@gmail.com>2017-02-16 17:18:01 +0900
commitce43ea9f4273ef2b4c67cb02dc55ed883f6c0fd9 (patch)
tree46403e619d0f53cd5f10bc255ae75612f9e32f61 /shell/key-bindings.bash
parent21da02fac2a6f8fd04052165efa52f8c11399bb7 (diff)
[shell] Replace `sed` with `-mindepth 1` and `cut` (#844)
Diffstat (limited to 'shell/key-bindings.bash')
-rw-r--r--shell/key-bindings.bash4
1 files changed, 2 insertions, 2 deletions
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"
}