How vim defines a sentence. How can I wrap a sentence as quickly as possible


I have been using vim for 2 years now. I always want to conclude an offer. For example, in python:



Now cusor is under the word



How can I wrap

using '' as quickly as possible, in other words, how can I quote a sentence.

I wonder how vim defines a sentence.



source to share

1 answer

A sentence in vim must end with either a .

, !

or ?

, followed by either the end of the line, or a space or tab. See :h sentence

. Therefore, you cannot view your line as an offer.

However, you can think of it class.method(

as vim WORD

since it has no spaces. See :h WORD


To surround WORD

in "

in normal vim, you can do: ciW"

ctrl- r ""


As @Yosh pointed out, you probably would like ci("

ctrl- r ""


You may also be interested in tpope surround.vim .



All Articles