Created
October 7, 2018 16:40
-
-
Save ctaylo21/13694d28831e2aa6eb573f94201e4b80 to your computer and use it in GitHub Desktop.
Alias for using fzf to fuzzy-find files and then open the match with vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fo [FUZZY PATTERN] - Open the selected file with the default editor | |
# - Bypass fuzzy finder if there's only one match (--select-1) | |
# - Exit if there's no match (--exit-0) | |
fo() { | |
local files | |
IFS=$'\n' files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0)) | |
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment