summaryrefslogtreecommitdiff
path: root/shell/key-bindings.zsh
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-11-08 00:11:46 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-11-08 00:12:12 +0900
commite99731ea852d1faac5390594cd980708edf826cf (patch)
tree91705daf049196425808c621d4676c1111813057 /shell/key-bindings.zsh
parent15659ac6e6ae413d86dc8229c7827e6983bad9db (diff)
downloadfzf-e99731ea852d1faac5390594cd980708edf826cf.tar.gz
[shell] Add FZF_ALT_C_COMMAND for ALT-C (#408)
Diffstat (limited to 'shell/key-bindings.zsh')
-rw-r--r--shell/key-bindings.zsh7
1 files changed, 4 insertions, 3 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index eccc8266..29721fc9 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -4,7 +4,7 @@ if [[ $- == *i* ]]; then
# CTRL-T - Paste the selected file path(s) into the command line
__fsel() {
- local cmd="${FZF_CTRL_T_COMMAND:-"command \\find -L . \\( -path '*/\\.*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \
+ local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . \\( -path '*/\\.*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \
-o -type f -print \
-o -type d -print \
-o -type l -print 2> /dev/null | sed 1d | cut -b3-"}"
@@ -27,8 +27,9 @@ bindkey '^T' fzf-file-widget
# ALT-C - cd into the selected directory
fzf-cd-widget() {
- cd "${$(command \find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
- -o -type d -print 2> /dev/null | sed 1d | cut -b3- | $(__fzfcmd) +m):-.}"
+ local cmd="${FZF_ALT_C_COMMAND:-"command find -L . \\( -path '*/\\.*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \
+ -o -type d -print 2> /dev/null | sed 1d | cut -b3-"}"
+ cd "${$(eval "$cmd" | $(__fzfcmd) +m):-.}"
zle reset-prompt
}
zle -N fzf-cd-widget