vim Manipulating text Using "verbs" and "nouns" for text editing


Example

One of the ways to think about the commands that should be executed, to edit a text in a certain manner, is as entire sentences.

A command is an action performed on an object. Therefore it has a verb:

:normal i    " insert
:normal a    " append
:normal c    " overwrite
:normal y    " yank (copy)
:normal d    " delete

Some of these words work with an object like d, c, y. Such objects can be word, line, sentence, paragraph, tag. One can use these in combination:

:normal dw    " deletes the text from the position of the cursor to the end of the next word
:normal cw    " deletes the text from the cursor to the end of the next word and
              " enters insert mode

Also one could use a modifier to specify precisely where should the action be executed:

:normal diw    " delete inside word. I.e. delete the word in which is the cursor.
:normal ciw    " removes the word, the cursor points at and enters insert mode
:normal ci"    " removes everything between the opening and closing quotes and
               " enters insert mode
:normal cap    " change the current paragraph
:normal ct8    " remove everything until the next number 8 and enter insert mode
:normal cf8    " like above but remove also the number
:normal c/goal " remove everything until the word 'goal' and enter insert mode
:normal ci{    " change everything inside the curly braces

More resources:

Learn to speak vim — verbs, nouns, and modifiers!

Learning Vim in 2014: Vim as Language

VimSpeak editing using Speech Grammar