-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial import of the r2pipe support for Vim
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
D=${HOME}/.vim/ftdetect | ||
|
||
all: | ||
|
||
mkdir -p $(D) | ||
cp -f r2pipe.vim $(D) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# r2pipe.vim | ||
|
||
This vim plugin allows you to run r2 commands into the current Vim buffer | ||
|
||
## Installation | ||
|
||
Just type `make`. If you want to get rid of that run: `make uninstall` | ||
|
||
Note that the same code works with neovim. But it's not yet installed. Contribs are welcome | ||
|
||
## How to use | ||
|
||
In one terminal start the r2 webserver | ||
|
||
In vim open | ||
|
||
## Future | ||
|
||
Right now this is just a PoC, but there are a lot of things to be done to improve the integration between r2 and vim | ||
|
||
* [ ] Use r2p instead of `curl` (one less dependency, and support socket files, pipes..) | ||
* [ ] Make interactive buffers and use the right syntax highlighting for disasm, hexa, .. | ||
* [ ] Setup split layouts to navigate function list, disasm, etc | ||
* [ ] Improve apis |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
|
||
|
||
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 |