Tuesday, March 7, 2023

Re: get better copy backwards



вт, 7 мар. 2023 г., 10:21 Enan Ajmain <3nan.ajmain@gmail.com>:
This behavior annoys me as well.  Fortunately I don't need to yank
backward too often.

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.

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.

--
Enan
3nan.ajmain@gmail.com
https://www.github.com/3N4N

--
--
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/20230307132118.6b628228%40cirdan.

Getting exclusive-inclusive difference is easier than it looks at first: exclusive motions always exclude the rightmost character. This is both weird and normal at the same time, as driving a car: turning wheel to the right always turns car to the right, no matter if it goes forward or backward.

Kind regards,
Matvey

--
--
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/CAFsTB%2B%2BFx1hMQkDk3djewezaNr_M2vdj3NCw6ManPKF-GJm0Yw%40mail.gmail.com.

No comments:

Post a Comment