From dda24ddca24c81a76bf166e9254ef17bab879bd6 Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:44:45 +0200 Subject: [PATCH] improv: path-copying commands now always copy to system clipboard --- README.md | 8 +------- lua/genghis/init.lua | 9 ++------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b414f9a..519d792 100644 --- a/README.md +++ b/README.md @@ -105,13 +105,7 @@ to the trash location. - `.copyRelativeDirectoryPath` or `:CopyRelativeDirectoryPath`: Copy the relative directory path. -When `clipboard="unnamed[plus]"` has been set, copies to the `+` register, -otherwise to `"`. To always use system clipboard, put this in your configuration -file: - -```lua -vim.g.genghis_use_systemclipboard = true -``` +All commands use the system clipboard. ### Disable Ex-Commands diff --git a/lua/genghis/init.lua b/lua/genghis/init.lua index 20083df..5c7ee9d 100644 --- a/lua/genghis/init.lua +++ b/lua/genghis/init.lua @@ -194,14 +194,9 @@ end ---copying file information ---@param expandOperation string local function copyOp(expandOperation) - local reg = '"' - local clipboardOpt = vim.opt.clipboard:get() - local useSystemClipb = vim.g.genghis_use_systemclipboard - or (#clipboardOpt > 0 and clipboardOpt[1]:find("unnamed")) - if useSystemClipb then reg = "+" end - + local register = "+" local toCopy = fn.expand(expandOperation) - fn.setreg(reg, toCopy) + fn.setreg(register, toCopy) vim.notify(toCopy, vim.log.levels.INFO, { title = "Copied" }) end