Tuesday, November 27, 2012

Re: Custom whitespace handling for cut and paste

On Tuesday, November 27, 2012 9:40:33 AM UTC-6, coot_. wrote:
>
>
>
> Yes and no. You can make a sentence text object which will add the
>
> missing spaces to the yanked text

This exists with the "as" text object.

For example:

Sentence one. Sentence two. Sentence three.
Sentence four. Sentence five. Sentence six.

Place the cursor anywhere on "Sentence two." Type the three keys,
"das". Place the cursor on the space between "Sentence four." and "Sentence five." Press p to paste. Get:

Sentence one. Sentence three.
Sentence four. Sentence two. Sentence five. Sentence six.

It doesn't do the smart rebalancing of spaces on the paste; perhaps you could add that with a mapping. But the cut/copy is easy.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: