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

all.

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

class.method(http://v.youku.com/v_show/id_XNzc4MzE1NzQ4.html)

      

Now cusor is under the word

v_show

      

How can I wrap http://v.youku.com/v_show/id_XNzc4MzE1NzQ4.html

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

I wonder how vim defines a sentence.

Thank!

+3


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(http://v.youku.com/v_show/id_XNzc4MzE1NzQ4.html)

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 .

+7


source







All Articles