From 5c9e207f2c02312202778d52753499cdf099f0f4 Mon Sep 17 00:00:00 2001 From: Ahmed Yasser Date: Wed, 19 Jul 2023 10:18:21 +0000 Subject: [PATCH] fix some bindings in insert mode bindings' table --- Editors/vim/Insert-Mode.md | 57 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/Editors/vim/Insert-Mode.md b/Editors/vim/Insert-Mode.md index d6d00d3..0b6612d 100644 --- a/Editors/vim/Insert-Mode.md +++ b/Editors/vim/Insert-Mode.md @@ -6,34 +6,34 @@ Vim's insert mode contains many useful features. There are many ways to get into insert mode from the normal mode. Here are some of them: -| Key | Function| -|------|---------| -| `i ` |Insert text **before** the cursor. | -| `I ` |Insert text before the first non-blank character of the line. | -| `a ` |Append text **after** the cursor. | -| `A ` |Append text **at the end of line**. | -| `o ` |Starts a new line **below** the cursor and insert text. | -| `O ` |Starts a new line **above** the cursor and insert text. | -| `s ` |Delete the character under the cursor and insert text. | -| `S ` |Delete the current line and insert text. | -| `cw` |Delete the current word and insert text. | -| `cc` |Change line by clearing and then entering insert mode. | -| `gi` |Insert text in same position where the last insert mode was stopped.| -| `gI` |Insert text at the start of line (column 1). | +| Key | Function | +| ---- | --------------------------------------------------------------------------------------------------- | +| `i ` | Insert text **before** the cursor. | +| `I ` | Insert text before the first non-blank character of the line. | +| `a ` | Append text **after** the cursor. | +| `A ` | Append text **at the end of line**. | +| `o ` | Starts a new line **below** the cursor and enter insert mode. | +| `O ` | Starts a new line **above** the cursor and enter insert mode. | +| `s ` | Delete the character under the cursor and enter insert mode. | +| `S ` | Delete the current line and enter insert mode. | +| `cw` | Delete from the **current** cursor's position to the end of the current word and enter insert mode. | +| `cc` | Change line by deleting it and then entering insert mode. | +| `gi` | Insert text in same position where the last insert mode was stopped. | +| `I` | Insert text at the start of line (column 1). | ## Different Ways To Exit Insert Mode There are a few different ways to return to the normal mode while in the insert mode: -| Key | Function| -|--------|---------| -|` `|Exits insert mode and go to normal mode.| -|`Ctrl-[`|Exits insert mode and go to normal mode.| -|`Ctrl-C`|Like `Ctrl-[` and ``, but does not check for abbreviation.| +| Key | Function | +| -------- | --------------------------------------------------------------- | +| ` ` | Exits insert mode and go to normal mode. | +| `Ctrl-[` | Exits insert mode and go to normal mode. | +| `Ctrl-C` | Like `Ctrl-[` and ``, but does not check for abbreviation. | ## Repeating Insert Mode -You can insert text multiple times by passing a count parameter before entering insert mode. +You can insert text multiple times by passing a count parameter before entering insert mode. **For example:** `10i` @@ -45,22 +45,21 @@ If you type `"hello world!"` and **exit** insert mode, Vim will repeat the text When you make a typing mistake, it can be cumbersome to type repeatedly. It may make more sense to go to normal mode and delete your mistake. You can also delete several characters at a time while in insert mode. -| Key | Function| -|--------|---------| -|`Ctrl-H`|Delete one character **before** the cursor.| -|`Ctrl-W`|Delete one word **before** the cursor.| -|`Ctrl-U`|Delete the entire line **before** the cursor..| +| Key | Function | +| -------- | ---------------------------------------------- | +| `Ctrl-H` | Delete one character **before** the cursor. | +| `Ctrl-W` | Delete one word **before** the cursor. | +| `Ctrl-U` | Delete the entire line **before** the cursor.. | **Important Note** You can't undo these deletions. However, what you've typed is still in the `.` register. - ## Executing Normal Mode Command (Insert Normal Mode) -You can use `CTRL-O` to execute a **one** normal-mode command without leaving insert mode. +You can use `CTRL-O` to execute a **one** normal-mode command without leaving insert mode. -When you press `Ctrl-o`, you'll be in **insert-normal** sub-mode. If you look at mode indicator on bottom left, normally you will see `-- INSERT --`, but `Ctrl-o `will change it to `-- (insert) --`. +When you press `Ctrl-o`, you'll be in **insert-normal** sub-mode. If you look at mode indicator on bottom left, normally you will see `-- INSERT --`, but `Ctrl-o `will change it to `-- (insert) --`. ### Example 1 : Navigating while remaining in insert mode @@ -74,4 +73,4 @@ If you're at the bottom of the screen. You can center your current position by d If you wanted to delete a block of text from your current position to an anchor, say a comma, you can just do `Ctrl-o d t ,` ---------------------------------------------------------- \ No newline at end of file +---