-
Notifications
You must be signed in to change notification settings - Fork 129
Home
John Hawthorn edited this page Jul 24, 2016
·
13 revisions
Here are some scripts people have built using fzy. Please feel free to add your own.
FILE=$(ag -l -g '' | fzy) && vim "$FILE"
This has to be a shell function (not script file) in order to use cd
fcd(){
cd "$(find -type d | fzy)"
}
#!/bin/sh
GEM=$(bundle list | cut -f 4 -d' ' | fzy)
DESTINATION=$(bundle show $GEM)
tmux new-window -c "$DESTINATION" -n "$GEM"
alias fzyank='fzy | xclip'
Based on snippet from selecta's EXAMPLES.md
function insert-fzy-path-in-command-line() {
local selected_path
echo # Run fzy underneath the current prompt
selected_path=$(ag . -l -g '' | fzy) || return
LBUFFER="$LBUFFER${(q)selected_path} " # ${(q)VAR} shell-escapes the string
zle reset-prompt
}
zle -N insert-fzy-path-in-command-line
unsetopt flowcontrol # By default, ^S freezes terminal output, only needed if keybinding is ^S
bindkey "^S" "insert-fzy-path-in-command-line"