-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: copy/paste to system clipboard #556
Comments
There are actions to copy the file path, but if you want to copy the file itself that would require something like the osascript you linked. I would review a PR that adds an action with that functionality. |
This would be pretty cool -- it seems it's a bit harder on Linux but very doable. I've made a fork to start tinkering with this on macOS, at least. |
As a sidenote, the keybinds |
I’ve created a simple version of copying/pasting to the macOS clipboard, and it works. But it needs further investigation, made an ugly implementation of #156 |
Or, we could implement it during rendering, though that’s not ideal either, but at least it’s asynchronous. If you all have any better ideas, please let me know, and I’d be happy to help. |
I'm using this approach to open the path in finder, after that you can copy it from there (one more step though) ["<c-cr>"] = function()
require("oil.actions").yank_entry.callback()
local path = vim.fn.getreg('"')
-- show in finder
vim.system({ "open", "-R", path }):wait()
end,
["<d-cr>"] = function()
require("oil.actions").yank_entry.callback()
local path = vim.fn.getreg('"')
-- directly open
vim.system({ "open", path }):wait()
end, |
Did you check existing requests?
Describe the feature
Hi! This plugin has become an essential tool for me to browse file directories. However, in some cases, using the system’s graphical file explorer (and any other tools) is more convenient. I’d like the ability to copy files from Neovim and paste them into the system clipboard (and vice versa), just like copying and pasting files in a graphical file explorer.
Provide background
When I connect a removable device, the path is often difficult to input manually. Similarly, when I want to send files to other applications (like a browser or chat software), I have to manually open the file explorer, copy the file, and then paste it into the application.
What is the significance of this feature?
strongly desired
Additional details
I’m not sure if this is feasible on all systems, but on macOS, it can be achieved using osascript.
The text was updated successfully, but these errors were encountered: