Skip to content

Instantly share code, notes, and snippets.

@tjs-w
Last active January 31, 2019 19:53
Show Gist options
  • Save tjs-w/7a8dedb6d366d5b42cf52368f13774c8 to your computer and use it in GitHub Desktop.
Save tjs-w/7a8dedb6d366d5b42cf52368f13774c8 to your computer and use it in GitHub Desktop.
zsh widget to open file through fasd in editor (vim)
fzf_fasd_ed () {
local ed=${EDITOR:-vim}
local file=$(fasd -Rlf | \
fzf --height=40% --reverse --prompt="${ed}> ")
[[ -z ${file} ]] && return
# ${ed} ${file} < /dev/tty
BUFFER="${ed} ${file}"
zle reset-prompt
zle accept-line
}
zle -N fzf_fasd_ed
bindkey '^[e' fzf_fasd_ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment