Skip to content

Commit 4521c43

Browse files
author
Venkata Subramani Renduchintala
committed
refactor(clipboard): simplify g:clipboard to built-in wl-copy string form
Nvim natively auto-detects wl-copy on Wayland; the full dict override was redundant. The string form 'wl-copy' pins the provider without needing to replicate the built-in command list.
1 parent a755e4c commit 4521c43

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

lua/settings.lua

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
local utils = require("utils")
22

3+
-- Force wl-copy provider; must be set before has('clipboard') is called.
4+
-- Nvim auto-detects wl-copy on Wayland, but the explicit string form pins
5+
-- the provider and skips the detection loop.
36
if vim.fn.has("unix") == 1 and vim.fn.executable("wl-copy") == 1 and vim.env.WAYLAND_DISPLAY then
4-
vim.g.clipboard = {
5-
name = "wl-clipboard",
6-
copy = {
7-
["+"] = { "wl-copy", "--type", "text/plain" },
8-
["*"] = { "wl-copy", "--primary", "--type", "text/plain" },
9-
},
10-
paste = {
11-
["+"] = { "wl-paste", "--no-newline" },
12-
["*"] = { "wl-paste", "--no-newline", "--primary" },
13-
},
14-
cache_enabled = 0,
15-
}
7+
vim.g.clipboard = "wl-copy"
168
end
179

1810
local options = {

0 commit comments

Comments
 (0)