Vim's text object

Source: Internet
Author: User

The text object of Vim is made up of two characters, and the first character is always i or a . In general, text objects that start with the text i selected inside the delimiter, and the a text object that begins with the selection, selects the entire text, including the delimiter. In order to facilitate memory, you can think of it i as "inside" and think of it a as "around" or "all". Vim's text object is mainly used to enlarge the selection, and it will be extremely powerful to combine it with visual mode or surround, and some common text objects are listed below.

Text Object Select Area
a) or AB Pair of parentheses
i) or IB Inside parentheses
A} or AB A pair of curly braces
i} or IB Curly braces Inside
At A pair of XML tags
It Inside the XML tag
Aw Current Word and a space
Iw Current word
AW Current string and a space
IW Current string
As Current sentence and a space
Is Current sentence
Ap Current paragraph and a blank line
Ip Current paragraph

The text object can also be combined with the corresponding action, such as d delete, y copy.

Vim's text object

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.