Monday, March 6, 2023

Re: get better copy backwards



On Mon, Mar 6, 2023 at 11:17 AM Igor Lerinc <igor.lerinc7@gmail.com> wrote:
imagine i have line of text:
echo "Zdravo, " . $_GET["ime"] . " " . $_GET["prezime"] . "." . "<br/><br/>";

my cursor is 

echo "Zdravo, " . $_GET["ime"] . " " . $_GET["prezime"] . "." . "<br/><br/>";

and then, i move cursor to ] with f
it will go before last character in word

echo "Zdravo, " . $_GET["ime"] . " " . $_GET["prezime". "." . "<br/><br/>";

and if i want to yank it backwards to $
i need to move my cursor to left and only then yank it backwards

i really hate that 'feature', why cursor can't just sit and go to the last character in word?

Igor,

It's possible I didn't fully understand the problem you're facing. Are you saying that you aren't sure about how to yank backwards or are you saying that the backward yank doesn't include the ] where your cursor currently is?

If the first, then just as 'f' and 't' move forward to a given character, 'F' and 'T' move backward. In your case, you could just do 'y2F$' (all without the quotes, of course).

Additionally, you could use the EasyMotion plugin (https://www.vim.org/scripts/script.php?script_id=3526) if you have a lot of $ signs and don't want to try to count them before issuing the command.

If the second, then, yes, you have first move over a single character before doing the yank. Perhaps you could create a mapping that moves you over and does the yank?

Hope this helps,

Salman

--
--
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/CANuxnEd42%2BBhqUKCfNNj4MjRGE6Z3WdvJdDcEKD8-N%3D0sYZzRw%40mail.gmail.com.

No comments: