nvim-anywise-reg.lua icon indicating copy to clipboard operation
nvim-anywise-reg.lua copied to clipboard

Suggestion

Open IndianBoy42 opened this issue 4 years ago • 3 comments

To fulfill the potential of the name 'anywise' we could try add the option of copying and pasting as any text object.

  • Copy a line and paste it in the middle of another (linewise to charwise)
  • Copy a function and paste it after the class
  • Copy around some parentheses and paste after the current word
  • (This could be done by ep, but im thinking of a more general mechanism)

One keymapping (although this breaks a core vim mechanic) is something like pa{textobject} for 'paste after {textobject}'. Of course the keymapping should be up to the user to find a place for themselves. But as a feature this could be good

IndianBoy42 avatar Jul 04 '21 21:07 IndianBoy42

Thanks for your suggestion @IndianBoy42. I might be missing something but I'm not sure I see the point of having a keymapping such as pa{textobject}. If the user anyway need to specify the textobject they can just go to the end of it and paste manually. Such as va{textobject}<Esc>p (of course there are even easier ways depending on what is pasted such as f<Space>p, ]mp, ]]p). But I'm happy to be convinced :)

AckslD avatar Jul 04 '21 21:07 AckslD

Apart from being 2 keystrokes longer and having to stretch for esc. Additionally the existing functionality would kind of block this:

Like I may want to copy a function and paste it after some parentheses for example, even navigating to where i want to paste and pasting would send the copied function past where i want it. This specific examples could be fixed by just invoking the original paste command somehow.

So we need a way to disable the smart anywise pasting. But as a matter of further orthogonality. Copying as one text object then pasting as/after another with a smooth flow sounds appealing to me and a natural extension of the current plugin

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Axel Dahlberg @.> Sent: Monday, July 5, 2021 5:17:09 AM To: AckslD/nvim-anywise-reg.lua @.> Cc: Anshuman MEDHI @.>; Mention @.> Subject: Re: [AckslD/nvim-anywise-reg.lua] Suggestion (#1)

Thanks for your suggestion @IndianBoy42https://github.com/IndianBoy42. I might be missing something but I'm not sure I see the point of having a keymapping such as pa{textobject}. If the user anyway need to specify the textobject they can just go to the end of it and paste manually. Such as va{textobject}<Esc>p. But I'm happy to be convinced :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/AckslD/nvim-anywise-reg.lua/issues/1#issuecomment-873664237, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNUNQOX73PXW2JDNJ52UH3TWDFVLANCNFSM47ZRKIFA.

IndianBoy42 avatar Jul 04 '21 22:07 IndianBoy42

I agree that there should be a way to do standard paste easily, I opened #4 for that. Pasting after a different textobject, I'm still not sure it has much of a benefit. It seems that one could do that with just plain keybinds without the need for a more complex plugin.

AckslD avatar Jul 05 '21 06:07 AckslD