Skip to content

Commit

Permalink
reference: udpate speaking vim page
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalli-johnny committed Jan 7, 2025
1 parent 04322ae commit 5a7b41f
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions docs/reference/modal-editing/speaking-vim.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,33 @@

Neovim is easier to learn and gain much more benefit from if you learn to speak commands as sentences.

First learn some verbs:
The structure of the language takes one of the forms:


!!! TIP "keys are mnemonic or regex"
keys were designed to be mnemonic where possible, e.g. ++"d"++ for delete and ++"c"++ for change

Common regular expression scopes are used, e.g. ++0++ first character, ++dollar++ last character

## Actions

First learn some verbs, these are your actions:

- `c` change
- `d` delete
- `g` go,
- ++"d"++ delete
- `g` go
- `v` visual select
- `y` yank (copy)

Then use those verbs with some modifiers
!!! TIP "Double tap to act on current line"
++"d"++ ++"d"++ deletes the current line

++"y"++ ++"y"++ yanks (copies) the current line


## Motions

Then use those verbs with some motions

- `'` mark
- `{ }` beginning/end of paragraph
Expand All @@ -23,13 +41,15 @@ Then use those verbs with some modifiers
- `s` surround
- `t` till (move just before specified character)

## Text Objects

Then learn the text objects you can apply verbs and modifiers too

- `b` block/parentheses
- `p` paragraph,
- `s` sentence
- `t` tag e.g. html/xml
- `w` word
- `b` **block/parentheses** a text block or text between parens
- `p` **paragraph** - text to the next blank line
- `s` **sentence** - text to a full stop character
- `t` **tag** e.g. html/xml
- `w` **word** - blank space separated text


## Examples of speaking Vim
Expand All @@ -56,3 +76,11 @@ Practice speaking evil with these examples
| `y y` | yank (copy) current line |
| `y w` | yank (copy) current word |
| `y @ a` | yank (copy) to mark `a` (`m a` creates a mark called `a`) |


<!--
- actions motion
- actions number motion
- actions text object
- actions number text object
-->

0 comments on commit 5a7b41f

Please sign in to comment.