Last active
January 31, 2019 19:53
-
-
Save tjs-w/7a8dedb6d366d5b42cf52368f13774c8 to your computer and use it in GitHub Desktop.
zsh widget to open file through fasd in editor (vim)
This file contains 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
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