Tuesday, April 9, 2013

Re: Problem with Visual selection on an empty line

Hi glts!

On Di, 09 Apr 2013, glts wrote:

> When a "v" Visual selection ends on an empty line it will also delete
> the newline and join the next line. Is there a way to avoid this?
>
> Here's an example text with the cursor on b:
>
> abc
> d
> xyz
>
> Now pressing vj and then d results in:
>
> axyz
>
> I would not have expected line 3 joined to line 1 but I can see that
> it's because I also deleted the newline on line 2. Thus I can simply use
> h to exclude the newline. Same situation, pressing vjhd gives:
>
> a
> xyz
>
> But what if the line between abc and xyz is empty?
>
> abc
>
> xyz
>
> Now vjd will always result in:
>
> axyz
>
> But I don't like this, it goes against my intuition. Is there a way to
> tell Vim not to include the newline character in the Visual selection,
> so that I get the same result as with vjhd?

:set selection=exclusive

regards,
Christian
--
Wenn uns das Böse als Böses Reue macht und nicht als Wirkung der
Strafe: warum bereuen wir einen bösen Willen, einen bösen Entschluß,
der nicht ausgeführt wurde, nicht ebensosehr als eine böse Handlung?
-- Jean Paul

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: