From 8b201e213209c016d9208735cffe4e83b47a81f3 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 25 Apr 2024 18:50:30 +0300 Subject: nvim: use xsel_override when xsel is present so only on x11 --- .config/nvim/lua/plugins/cutlass.lua | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.config/nvim/lua/plugins/cutlass.lua b/.config/nvim/lua/plugins/cutlass.lua index b9332a9..521c906 100644 --- a/.config/nvim/lua/plugins/cutlass.lua +++ b/.config/nvim/lua/plugins/cutlass.lua @@ -32,19 +32,22 @@ return { { "gbprod/yanky.nvim", config = function() - -- fix Target STRING not available - vim.g.clipboard = { - name = 'xsel_override', - copy = { - ['+'] = 'xsel --input --clipboard', - ['*'] = 'xsel --input --primary', - }, - paste = { - ['+'] = 'xsel --output --clipboard', - ['*'] = 'xsel --output --primary', - }, - cache_enabled = 1, - } + if vim.fn.executable('xsel') == 1 then + -- fix Target STRING not available + -- if we are using xsel (X11) + vim.g.clipboard = { + name = 'xsel_override', + copy = { + ['+'] = 'xsel --input --clipboard', + ['*'] = 'xsel --input --primary', + }, + paste = { + ['+'] = 'xsel --output --clipboard', + ['*'] = 'xsel --output --primary', + }, + cache_enabled = 1, + } + end local map = require("helpers.keys").map -- cgit v1.2.3-70-g09d2