vim

Motions and Text Objects

Remarks#

A text object in Vim is another way to specify a chunk of text to operate on. They can be used with operators or in visual mode, instead of motions.

Changing the contents of a string or parameter list

Let’s say you have this line of code:

printf("Hello, world!\n");

Now say you want to change the text to “Program exiting.”

Command Buffer Mnemonic
ci" printf("¦"); change in the .
Program exiting.\n<esc> printf("Program exiting.\n");

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow