|
| 1 | +--- |
| 2 | +title: LazyVim for Omarchy |
| 3 | +date: 2025-08-18 |
| 4 | +--- |
| 5 | + |
| 6 | +## What is modal editing |
| 7 | + |
| 8 | +Most modern text editors have a single mode where every key you enter gets inserted into on open document. |
| 9 | + |
| 10 | +In these editors, you access editing with modifier keys (e.g., <kbd>⌘</kbd>, <kbd>⌥</kbd>, <kbd>⌃</kbd>, etc). |
| 11 | + |
| 12 | +Modal editors behave differently. |
| 13 | +In modal editors, you switch between modes to complete different editing operations. |
| 14 | + |
| 15 | +## What are major modes in Vim? |
| 16 | + |
| 17 | +`Insert` |
| 18 | +: The text editing mode you're used to. Type; characters get inserted. |
| 19 | + |
| 20 | +`Normal` |
| 21 | +: Every key is a macro or action (like a keyboard shortcut). |
| 22 | + |
| 23 | +`Command` |
| 24 | +: Issue editor commands, e.g., `write`, `quit`, `help`, etc. |
| 25 | + |
| 26 | +`Visual` |
| 27 | +: Make text selections (like holding <kbd>shift</kbd> or click-and-drag). |
| 28 | + |
| 29 | +## How do I make visual selections with motions? |
| 30 | + |
| 31 | +First, arrow keys work. |
| 32 | +So you can just use those in visual mode. |
| 33 | + |
| 34 | +But there better ways to make selections. |
| 35 | +I like to start with `word`/`Word` motions. |
| 36 | + |
| 37 | +<kbd>w</kbd>ord |
| 38 | +: move to the beginning of the next `word` (deleniated on whitespace and punctuation). |
| 39 | + |
| 40 | +<kbd>W</kbd>ord |
| 41 | +: move to the beginning of the next `WORD` (deleniated on whitespace). |
| 42 | + |
| 43 | +<kbd>b</kbd>eginning |
| 44 | +: move to the beginning of the previous `word` (deleniated on whitespace and punctuation). |
| 45 | + |
| 46 | +<kbd>B</kbd>eginning |
| 47 | +: move to the beginning of the previous `WORD` (deleniated on whitespace). |
| 48 | + |
| 49 | +<kbd>e</kbd>nd |
| 50 | +: move to the end of the next `word` (deleniated on whitespace and punctuation). |
| 51 | + |
| 52 | +<kbd>E</kbd>nd |
| 53 | +: move to the end of the next `word` (deleniated on whitespace). |
| 54 | + |
| 55 | +_(There is logical opposite to `e`/`E`. But you can use the `g` modifer to get it, with `ge`/`gE`)_ |
| 56 | + |
| 57 | +## How do I make visual selections with text objects? |
| 58 | + |
| 59 | +## What can you do with a visual selection? |
| 60 | + |
| 61 | +<kbd>d</kbd>elete |
| 62 | +: delete into `normal` mode |
| 63 | + |
| 64 | +<kbd>c</kbd>change |
| 65 | +: delete into `insert` mode |
| 66 | + |
| 67 | +<kbd>y</kbd>ank |
| 68 | +: yank into `normal` mode |
| 69 | + |
| 70 | +### Other notes |
| 71 | + |
| 72 | +``` |
| 73 | +## Thesis |
| 74 | +
|
| 75 | +Every editor you've used, as a modern programmer has just one editing mode. |
| 76 | +
|
| 77 | +Open a file, move the blinking cursor with your mouse, insert or delete text |
| 78 | +
|
| 79 | +For you, this is "normal". |
| 80 | +
|
| 81 | +in Vim, `normal` is something else. |
| 82 | +
|
| 83 | +
|
| 84 | +## Bridge |
| 85 | +
|
| 86 | +Insert mode is just one mode in Vim. |
| 87 | +But what if i told you tehre where other editing modes you use on a daily basis? |
| 88 | +
|
| 89 | +## Antithesis |
| 90 | +
|
| 91 | +Vim is a `modal` editor. |
| 92 | +You'll use multiple different modes to edit and operate on text. |
| 93 | +(Metaphors: Lightroom, video editor, physical workbench.) |
| 94 | +
|
| 95 | +## A simple end-to-end edit |
| 96 | +- open a file in vim (normal) |
| 97 | +- select an insertion point |
| 98 | +- make a visual selection (visual) and change (insert) |
| 99 | +- escape (normal) |
| 100 | +- save and close (command) |
| 101 | +``` |
0 commit comments