4 ms·
I also like a Ctrl+T for finding a file in the current directory. For example: bundle exec rspec <Ctrl+T>
by ryanbigg 4y ago
I also like a Ctrl+T for finding a file in the current directory.
For example:
bundle exec rspec <Ctrl+T>
- grimgrin 4y agoi use it a lot but want an accompanying binding just for directories edit: okay done http://i.imgur.com/n12DYUu.png 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 http://ix.io/4rtn/sh Sent from a LLM