Provides Terminal-api functions for opening files from terminal mode.
Plug 'tennashi/termopen.vim'
Tapi_open
opens <file_name>
.
["call", "Tapi_open", [<open_cmd>, <file_name>]]
<open_cmd>
specifies the vim command when opening with vim.
open
edit
drop
split
vsplit
tabnew
Tapi_open_wait
opens <file_name>
and returns <wait_string>
when editing is complete.
["call", "Tapi_open_wait", [<open_cmd>, <res_id>, <file_name>]]
{"res_id": <res_id>, "msg": "done"}
<open_cmd>
specifies the vim command when opening with vim.
open
edit
drop
split
vsplit
tabnew
echo -e "\x1b]51;[\"call\", \"Tapi_open_wait\", [\"edit\", \"response_id\", \"hoge\"]]\x07"
while :
do
read res
if [ "${res}" = "{\"res_id\":\"response_id\",\"msg\":\"done\"}" ]; then
exit
fi
done