1.8 KiB
1.8 KiB
universal-clipboard.nvim
A minimal Neovim plugin that automatically sets up sharing your system clipboard across multiple platforms. It addresses this issue:
Platform Differences: On macOS, Neovim appears to behave nicely with the system
clipboard. On others, not so much. External tools can help. For example, there’swl-copy/wl-pastefor Wayland orxclip/xselfor X11.
With universal-clipboard.nvim:
- If we detect an external clipboard tool (
wl-clipboard,xclip,xsel), we configure theclipboardto use it. - Otherwise, we simply set it to
unnamedpluswith no further configuration.
Installation
Using packer.nvim:
use({
"swaits/universal-clipboard.nvim",
config = function()
require("universal-clipboard").setup({
verbose = false, -- optional, set true to see a small startup message
})
end,
})
Or lazy.nvim:
{
"swaits/universal-clipboard.nvim",
opts = {
verbose = true, -- optional, set true to see a small startup message
},
}
Note: If your Neovim lacks
+clipboard, make sure you have at least one ofwl-clipboard,xclip, orxselis installed.
Default Options
{
-- If true, prints the chosen clipboard mode at startup
verbose = false,
}
Usage
Once installed, no additional steps are needed. The plugin configures your clipboard on startup. Simply copy and paste in Neovim as usual.
Commands
:UniversalClipboardCheck- Shows the currentclipboardconfiguration.:UniversalClipboardReinit- Re-runs detection. You do not normally need to run this. It's run automatically on startup.