Text Objects
Vim Text Editor Quick Reference
2 min read
Published Jul 6 2025
Guide Sections
Guide Comments
Here are some ways to select, delete or copy different text objects.
Using the text operator
v
- to enter visual mode.i
/a
- to select inner or around.text operator
- to define what is to be selected.
eg. v
i
w
will select the inner word.
List of text operator options
So you would use the below by doing v
i
keybelow
or v
a
keybelow
, depending if you want inner or outer selection:
Key | Description |
---|---|
p | Paragraph |
w | Word |
W | Word surrounded by white space |
s | Sentence |
t | HTML or XML tags |
" | Text between " quotes |
' | Text between ' quotes |
[or] | Text inside square brackets |
{or} | Text inside curly brackets |
(or) | Text in side normal brackets (parentesies) |
Deleting using the text operators
Rather than just selecting, you can also delete using the text operators above.
d
- the delete operator.i
/a
- to select inner or around.text operator
- to define what is to be deleted.
eg. d
i
w
will delete the inner word, or d
i
"
will delete everything inside the "" marks etc.
Changing text using the text operators
You can also use the text operators to select text, clear it and enter insert mode to make changes to the selection.
c
- the change operator.i
/a
- to select inner or around.text operator
- to define what is to be changed.
eg. c
i
w
will clear the selected inner word and leave you in insert mode to type new text. etc.
Copying (yanking) using the text operators
You can also use the text operators to copy text.
y
- the yank (copy) operator.i
/a
- to select inner or around.text operator
- to define what will be copied.
eg. y
i
w
will copy (yank) the selected inner word. etc.