Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

i use it a lot but want an accompanying binding just for directories

edit: okay done

http://i.imgur.com/n12DYUu.png

Two examples in case you have a preference w/ or w/o the preview:

    fzf_insert_directory_preview() {
      local dir
      dir=$(find . -type d -not -path '*/\.*' | fzf --height 40% --reverse --preview 'tree -C {} | head -200')
      if [[ -n $dir ]]; then
        READLINE_LINE="${READLINE_LINE}${dir}"
        READLINE_POINT=$((${#READLINE_LINE}))
      fi
    }

    fzf_insert_directory() {
      local dir
      dir=$(find . -type d -not -path '*/\.*' | fzf --height 40% --reverse)
      if [[ -n $dir ]]; then
        READLINE_LINE="${READLINE_LINE}${dir}"
        READLINE_POINT=$((${#READLINE_LINE}))
      fi
    }

    bind -x '"\ey": fzf_insert_directory_preview' # alt-y
    bind -x '"\et": fzf_insert_directory' # alt-t
http://ix.io/4rtn/sh

Sent from a LLM



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: