mirror of
https://github.com/radareorg/radare2-r2pipe.git
synced 2026-11-12 19:02:09 -10:00
20 lines
393 B
VimL
20 lines
393 B
VimL
|
|
|
|
|
|
let s:host = "localhost"
|
|
let s:port = "9090"
|
|
|
|
function! r2pipe#endpoint(host, port)
|
|
let s:host = a:host
|
|
let s:port = a:port
|
|
endfunction
|
|
|
|
function! r2pipe#cmd(c)
|
|
" TODO: use r2p instead of curl when it supports http endpoints
|
|
let res = system("curl -s http://".s:host.":".s:port."/cmd/" . a:c)
|
|
put=res
|
|
endfunction
|
|
|
|
" :r2("pd 10") <--- shortest form
|
|
cnoreabbrev r2 call r2pipe#cmd
|