fzf を使用してvimscriptでディレクトリ検索と置換機能を作成しようとしています。私がブロックする場所は、Alt-afzf バインディングを使用してリスト全体を選択しようとするときです。fzf が外部プロセスであることを考えると、それが可能かどうかさえわかりませんが、間違っている可能性があります。
これが私の現在の機能です。
function! CWDSearchAndReplace()
" Try to get word under cursor else prompt user for a word
let wordToReplace = expand("<cword>")
if wordToReplace == ""
call inputsave()
let wordToReplace = input("Replace: ")
call inputrestore()
endif
" Prompt for replacement
call inputsave()
let replacement = input("Replace \"" . wordToReplace . "\" with: ")
call inputrestore()
execute "Ag " . wordToReplace
" =====> Here I'd like to execute Alt-a followed by <CR>
execute "cdo %s//" . replacement . "/gc"
end function
ご協力いただきありがとうございます!