From a4c9dce5dbb862e83ac02cfc7d787d2f32429526 Mon Sep 17 00:00:00 2001 From: Anmol Pandita <39385082+anmolpandita1@users.noreply.github.com> Date: Sun, 22 May 2022 14:50:46 +0530 Subject: [PATCH] update --- content/notes/vim.md | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/content/notes/vim.md b/content/notes/vim.md index 6685050de..9193e7788 100644 --- a/content/notes/vim.md +++ b/content/notes/vim.md @@ -5,16 +5,51 @@ tags: --- ## Navigation +Navigating vim is beautiful ### Exiting πŸ‘» +| | | +| --------------- | ------------------------------------- | +| :q | to `quit` the file | +| :e! | to `trash` all changes and **reload** | +| :q! | to `trash` all changes and **quit** | +| :wq | to `save` the changes and **quit** | +| ZZ (Shift + zz) | to `save` the changes and **quit** | - -### Navigation - +## Navigation +| | | +| ---------------------------------- | -------------------------------------------- | +| h j k l | βƒͺ ↓ ↑ β†’ | +| 0 | to the `start` of the line | +| $ (Shit + 4) | to the `end` of the line | +| e | to `end` of word | +| w |`forward` one **word** | +| W |`forward` one **Word** | +| b |`backward` one **word** | +| B |`backword` one **Word** | +| *<`number`>* wW / e / bB / h j k l | Move *<`number`>* times *<`text objects`>* | +| *<`number`>* G | to **specific line** | +| % | to **matching parenthesis {} () []** | +| zz | re-center | ## Text manipulation - +| | | +| --- | --------------------------------------------- | +| x | delete at the cursor (β†’ in normal mode still) | +| i | insert before the cursor | +| I | insert beginning of the line | +| a | insert after the cursor | +| A | append after the line | +| o | open line above | +| O | open line below | +| s | delete character and insert | +| S | delete line and insert | +| R overstrike mode | replace text character by character (max 1 line) | +| c *<`movement`>* wW / bB / 2j / $/ 0 | change till (β†’ in insert mode now) | cc - change one line | +| d *<`movement`>* wW / bB / 2j / $/ 0 | delete till (β†’ in normal mode still) | dd - delete one line ... | +| r | replace single character (β†’ don’t have to press ESC) | +| *<`number`>* ~ | change letter case | > Remember - **(command)*(number)(text object)****