michaeljsmith / vim-indent-object

Vim plugin that defines a new text object representing lines of code at the same indent level. Useful for python/vim scripts, etc.
http://www.vim.org/scripts/script.php?script_id=3037
MIT License
735 stars 61 forks source link

Preserve cursor position for yank #22

Open Praful opened 4 years ago

Praful commented 4 years ago

I'm not sure if this plugin is still maintained.

When typing yai, the cursor moves to the beginning of the selection.

When typing vai, the cursor moves to the end of the selection.

There's some logic for moving when vai is used because you could continue selecting downwards. However, what is the rationale for moving the cursor when yai is typed? One possible justification is that if you're in a method and yank it, moving to the top would let you paste the recently yanked text ie to duplicate the method.

It would be nice to have the choice of moving the cursor or not.

haolian9 commented 2 years ago

it seems yanking on all text object have this behavior: after yanking, the cursor goes to the beginning of the selection.

nonthless, i think `] could mitigate this pain point somehow.

(a while ago, I was wanting similar behavior in vim-exchange )