The Official Radare2 Book | страница 78



   • l - move one character forward

   • x - cuts the character

   • dw - delete the current word

   • diw - deletes the current word.

   • db - delete the previous word

   • D - delete the whole line

   • dh - delete a character to the left

   • dl - delete a character to the right

   • d$ - kill the text from point to the end of the line.

   • d^ - kill backward from the cursor to the beginning of the current line.

   • de - kill from point to the end of the current word, or if between words, to the end of the next word. Word boundaries are the same as forward-word.

   • p - yank the top of the kill ring into the buffer at point.

   • c - acts similar to d based commands, but goes into insert mode in the end by prefixing the commands with numbers, the command is performed multiple times.

If you are finding it hard to keep track of which mode you are in, just set scr.prompt.mode=true to update the color of the prompt based on the vi-mode.

The visual mode is a more user-friendly interface alternative to radare2's command-line prompt. It allows easy navigation, has a cursor mode for selecting bytes, and offers numerous key bindings to simplify debugger use. To enter visual mode, use V command. To exit from it back to command line, press q.

Navigation can be done using HJKL or arrow keys and PgUp/PgDown keys. It also understands usual Home/End keys. Like in Vim the movements can be repeated by preceding the navigation key with the number, for example 5j will move down for 5 lines, or 2l will move 2 characters right.

The Visual mode uses "print modes" which are basically different panel that you can rotate. By default those are:

Hexdump panel -> Disassembly panelDebugger panelHexadecimal words dump panelHex-less hexdump panelOp analysis color map panelAnnotated hexdump panel ↺.

Notice that the top of the panel contains the command which is used, for example for the disassembly panel:

[0x00404890 16% 120 /bin/ls]> pd $r @ entry0

To see help on all key bindings defined for visual mode, press ?:

Visual mode help:

? show this help

?? show the user-friendly hud

% in cursor mode finds matching pair, or toggle autoblocksz

@ redraw screen every 1s (multi-user view)

^ seek to the begining of the function

! enter into the visual panels mode

_ enter the flag/comment/functions/.. hud (same as VF_)