Is it possible to pull out the whole element without moving to the beginning?

When my cursor is in the middle of the word, and I want to tear out the whole word, I must first press b and press y w to take it out.

I want to know if I can rip out a word without pressing b first?

+4
source share
2 answers

y a w twitches around the word, which means that there is a space after the word, it will also capture it (but not the space before).

y i w is yank inside the word, which occupies only the characters of the word.

You can see that v a w or v i w will shake to select the same characters. Then you can press y to execute yank.

i and a , of course, apply to all other VIM groups, such as W , which is any non-decomposition.

+11
source

You can use y a w . As a side effect, this will move the cursor to the start of the capture area.

For more information, see Selecting text objects in the Vim documentation.

+4
source

Source: https://habr.com/ru/post/1388246/


All Articles