From f4834c7ff800aa06018997c5687c6ea507b63fe0 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 30 Aug 2024 09:58:31 +0200 Subject: nvim: update cutlass config (wayland) --- .config/nvim/lua/plugins/cutlass.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to '.config/nvim/lua/plugins') diff --git a/.config/nvim/lua/plugins/cutlass.lua b/.config/nvim/lua/plugins/cutlass.lua index 521c906..c3cabe4 100644 --- a/.config/nvim/lua/plugins/cutlass.lua +++ b/.config/nvim/lua/plugins/cutlass.lua @@ -32,7 +32,24 @@ return { { "gbprod/yanky.nvim", config = function() - if vim.fn.executable('xsel') == 1 then + if os.getenv("WAYLAND_DISPLAY") then + vim.g.clipboard = { + name = "wl-clipboard", + copy = { + ["+"] = 'wl-copy --foreground --type text/plain', + ["*"] = 'wl-copy --foreground --primary --type text/plain', + }, + paste = { + ["+"] = (function() + return vim.fn.systemlist('wl-paste --no-newline', { '' }, 1) -- '1' keeps empty lines + end), + ["*"] = (function() + return vim.fn.systemlist('wl-paste --primary --no-newline', { '' }, 1) + end), + }, + cache_enabled = true + } + else -- fix Target STRING not available -- if we are using xsel (X11) vim.g.clipboard = { -- cgit v1.2.3-70-g09d2