Tuesday, March 7, 2023

Re: get better copy backwards

On Di, 07 Mär 2023, Enan Ajmain wrote:

> To answer your question, vim motions are of two types:
> - ':h inclusive'
> - ':h exclusive'
>
> I don't understand that helpdoc well, but I understand that this is the
> reason 'yb' excludes the character the cursor was on. For fun, try
> 'yge', which is an inclusive motion. It's not a substitute of 'yb'
> (you'll see why when you try). It's just to demonstrate the reason why
> 'yb' behaves unintuitively.

Try using yvb which should force the motion to be inclusive, e.g.
include the right-most character. See :h o_v

> It's not gonna be changed upstream, but I bet patching your own copy of
> vim won't be too hard. If I were using 'yb' as often as you seem to be,
> I would've tried patching it.

That makes it even more confusing, if you'll have to use a non-patched
Vim.

Best,
Christian
--
Alles ist schon einmal gesagt worden, aber da niemand zuhört, muß man
es immer von neuem sagen.
-- André Gide

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZAb4hzSNAXgEpIuD%40256bit.org.

No comments:

Post a Comment