nvim-anywise-reg.lua
nvim-anywise-reg.lua copied to clipboard
Suggestion
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
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 :)
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.
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.