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 two common issues:
- Platform Differences: On macOS,
pbcopy/pbpasteis native; on Linux, there’swl-copy/wl-pastefor Wayland orxclip/xselfor X11. - Missing
+clipboard: Many distro packages ship Neovim without built-in clipboard support.
With universal-clipboard.nvim:
- If Neovim has
+clipboard, we simply useunnamedplus. - If not, we detect which clipboard tool (
wl-clipboard,xclip,xsel) is available, and configure a fallback automatically.
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
},
}
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.
Note: If your Neovim lacks
+clipboard, make sure you have at least one ofwl-clipboard,xclip, orxselis installed.
Commands
:UniversalClipboardCheck- Shows whether Neovim has+clipboardand the current fallback configuration, if any.:UniversalClipboardReinit- Re-runs detection. You do not need to run this. It's run automatically on startup.