feat: variation of #3334#3336
Conversation
There was a problem hiding this comment.
This is looking great, only minor changes required.
Please:
- handle spaces etc. in register as per
gptest case, moving to a newline delimited format as per "standard" with newlines between files, but not after the last file - move
Node:get_basenametoClipboard
Test cases:
gy
- copy one
/home/alex/src/linux/.mailmap - visual copy
/home/alex/src/linux/.pylintrc,/home/alex/src/linux/.rustfmt.toml - copy root
/home/alex/src/linux/ -
visual copy root and other nodes
root is not copied, however that's OK. This is existing behaviour and arguably a feature, as copying root and other files makes no sense.
ge
- copy one
.mailmap - visual copy
.pylintrc,.rustfmt - copy root
linux -
visual copy root and other nodes, ok, see above
gp
- paste one
/home/alex/src/linux/MAINTAINERS - paste many
/home/alex/src/linux/COPYING,/home/alex/src/linux/CREDITS - FAIL - paste with spaces
/home/alex/src/linux/CREDITS, /home/alex/src/linux/Kbuild, /home/alex/src/linux/Kconfig
[NvimTree] Could not copy /home/alex/src/linux/CREDITS - ENOENT - paste one inexistent
/home/alex/src/linux/xxx
[NvimTree] Could not copy /home/alex/src/linux/xxx - ENOENT - paste many, one inexistent
/home/alex/src/linux/Kbuild,/home/alex/src/linux/xxx,/home/alex/src/linux/MAINTAINERS
[NvimTree] Could not copy /home/alex/src/linux/xxx - ENOENT
others copied correctly - paste mixed nodes and directories
/home/alex/src/linux/zzz/,/home/alex/src/linux/aaa
gx
- Test cases as per
gp - Multiple source removed when in same instance
/home/alex/src/linux/Kconfig,/home/alex/src/linux/MAINTAINERS - Multiple source removed in other instance in the same directory
/home/alex/src/linux/.clang-format,/home/alex/src/linux/.clippy.toml
| end | ||
|
|
||
| function Node:get_basename() | ||
| if self.name == ".." then |
There was a problem hiding this comment.
On further reflection, changing the ".." makes me nervous. Yes it's legacy, however it is present in many places in Clipboard hence we shouldn't change it when building this feature.
Let's keep it localised - please move this method to Clipboard so that it doesn't spread to other functionality.
That would be great, I have some use cases for it. Out of scope, future PR please :) |
|
Wild and crazy idea after reading comments on previous PR: Remove
|
|
I finally installed the gnome file manager nautilus and inspected the clipboard mime types when copying multiple files: : ; wl-paste --list-types
x-special/gnome-copied-files
text/plain;charset=utf-8
text/uri-list
application/vnd.portal.filetransfer
application/vnd.portal.files
: ; wl-paste --type text/plain\;charset=utf-8
/home/alex/src/linux/.gitattributes
/home/alex/src/linux/.gitignore
/home/alex/src/linux/.mailmap
: ; wl-paste --type text/uri-list
file:///home/alex/src/linux/.gitattributes
file:///home/alex/src/linux/.gitignore
file:///home/alex/src/linux/.mailmap
: ; wl-paste --type application/vnd.portal.filetransfer
10924863569610452011%
: ; wl-paste --type application/vnd.portal.files
11848482484090875390%
: ; wl-paste --type x-special/gnome-copied-files
copy
file:///home/alex/src/linux/.gitattributes
file:///home/alex/src/linux/.gitignore
file:///home/alex/src/linux/.mailmap%
: ;Today I think we should at least match the
For reference, this is what a : ; wl-paste --list-types
text/plain
text/plain;charset=utf-8
TEXT
STRING
UTF8_STRING
: ; wl-paste --type UTF8_STRING
/home/alex/src/linux/Kbuild,/home/alex/src/linux/Kconfig
: ; wl-paste --type TEXT
/home/alex/src/linux/Kbuild,/home/alex/src/linux/Kconfig
: ; wl-paste --type STRING
/home/alex/src/linux/Kbuild,/home/alex/src/linux/Kconfig
: ; wl-paste --type text/plain
/home/alex/src/linux/Kbuild,/home/alex/src/linux/Kconfig
: ; wl-paste --type text/plain\;charset=utf-8
/home/alex/src/linux/Kbuild,/home/alex/src/linux/Kconfig
: ;KDE dolpin operates similarly except that it does not copy |
Makes total sense removing The only thing is that |
That's great. The unique problem usinf this approach is that it will resamble protocol and hence we won't be able to paste from anywhere else by simply grabbing the absolute path and vice-versa maybe. This would suite better if we kept |
Yeah that's a tricky one, there's no "natural" option. I'm easy for any mapping, however we can't do |
Yes, let's just go with newlines for now. This branch is working. We can add a protocol in the future :) |
The protocol will break OS level operation, which I think is one of the biggest win for this. And yes protocol would make this nvim specific but I think it would be cooler to make it work anywhere. Changes To Be Made
Together with those mentioned earlier. |


Hello @alex-courtis this is simply a variation of what we've been discussing at #3334 I just wanted to show it in practice and is btw the thing that I've been dogfooding, I am thinking in even adding option to download a file directly when an url is on the register (maybe for my own locally if this is too nichy).
Changes
1 -
gy- remains as it is, and now supports visual operation which copies a list of comma separated absolute paths2 -
gp- this is used to paste while copying3 -
gx- this is used to paste while cutting.2026-06-15.00-39-13.mp4