From 813115aa6a24fc754925b162ca333eddae1157f6 Mon Sep 17 00:00:00 2001 From: yep Date: Thu, 4 Jan 2024 11:53:28 +0100 Subject: [PATCH] update dietline vi-mode docs --- src/basic_commands/dietline.md | 38 ++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/basic_commands/dietline.md b/src/basic_commands/dietline.md index 0d5d007f..6badcd33 100644 --- a/src/basic_commands/dietline.md +++ b/src/basic_commands/dietline.md @@ -65,19 +65,45 @@ Radare2 also comes with in vi mode that can be enabled by toggling `scr.prompt.v - `$` - move to the end of the line - `h` - move one character backward - `l` - move one character forward +- `b` - move cursor to the beginning of the current word, of if between word boundaries, to the beginning of the previous word. +- `B` - same as `b`, but only counting white-space as word boundary +- `e` - move cursor the end of the current word, or if between boundaries, to the end of the next word +- `E` - same as `e`, but only counting white-space as word boundary +- `w` - move cursor to the beginning of the next word +- `W` - same as `w`, but only counting white-space as word boundary +- `f` - move cursor forward to the first `` found. For example `fj` will move the cursor to the first `j` character found (if it found one) +- `F` - same as `f`, but search backwards +- `t` - same as `f` but stop before ``. For example `tj` will move the cursor forward to the character just before `j` +- `T` - same as `t`, but search backwards ## Deleting and Yanking - `x` - cuts the character -- `dw` - delete the current word -- `diw` - deletes the current word. +- `dw` - delete the current word from the current position +- `diw` - delete inside the current word - `db` - delete the previous word -- `D` - delete the whole line +- `D` - delete from the current cursor position to the end of line +- `C` - same as `D`, but enter insert mode after +- `dd` - delete the whole line (from any position) +- `cc` - same as `dd`, but enter insert mode after - `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. +- `d$` - same as `D` +- `d^` - delete from the current cursor position to the beginning of 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. +- `df` - delete from current position to the position of the first `` encountered +- `dF` - same as `df`, but delete backwards +- `dt` - delete from current position to the position of the character right before the first `` encountered +- `dT` - same as `dt`, but delete backwards +- `di"` - delete everything between two `"` characters +- `di'` - delete everything between two `'` characters +- `di(` - delete everything between `(` and `)` characters +- `di[` - delete everything between `[` and `]` characters +- `di{` - delete everything between `{` and `}` characters +- `di<` - delete everything between `<` and `>` characters - `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. +- `c` - all `d` commands have their `c` counterpart which enters insert mode after deleting + +## Other +- `~` - swap the case of the current character and move one character forward 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.