乐闻世界logo
搜索文章和话题

What are the text objects in Vim and how to use them?

2月21日 15:13

Vim provides powerful text object operations for quickly selecting and manipulating text blocks. Common text objects include: w for word, W for whitespace-separated word, s for sentence, p for paragraph, ( or b for parentheses content, [ or ] for brackets content, { or B for braces content, < or > for angle brackets content, " for double quotes content, ' for single quotes content, ` for backticks content, t for tag content. Operations: ci" to change quotes content, ca" to change quotes and quotes, di" to delete quotes content, da" to delete quotes and quotes, yi" to copy quotes content, ya" to copy quotes and quotes. Text objects can be combined with c, d, y, v and other commands for precise text manipulation. Mastering text objects is one of the key skills for improving Vim editing efficiency.

标签:Vim