improv: path-copying commands now always copy to system clipboard
parent
01b1d297b0
commit
dda24ddca2
|
|
@ -105,13 +105,7 @@ to the trash location.
|
||||||
- `.copyRelativeDirectoryPath` or `:CopyRelativeDirectoryPath`: Copy the
|
- `.copyRelativeDirectoryPath` or `:CopyRelativeDirectoryPath`: Copy the
|
||||||
relative directory path.
|
relative directory path.
|
||||||
|
|
||||||
When `clipboard="unnamed[plus]"` has been set, copies to the `+` register,
|
All commands use the system clipboard.
|
||||||
otherwise to `"`. To always use system clipboard, put this in your configuration
|
|
||||||
file:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
vim.g.genghis_use_systemclipboard = true
|
|
||||||
```
|
|
||||||
|
|
||||||
### Disable Ex-Commands
|
### Disable Ex-Commands
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -194,14 +194,9 @@ end
|
||||||
---copying file information
|
---copying file information
|
||||||
---@param expandOperation string
|
---@param expandOperation string
|
||||||
local function copyOp(expandOperation)
|
local function copyOp(expandOperation)
|
||||||
local reg = '"'
|
local register = "+"
|
||||||
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 toCopy = fn.expand(expandOperation)
|
local toCopy = fn.expand(expandOperation)
|
||||||
fn.setreg(reg, toCopy)
|
fn.setreg(register, toCopy)
|
||||||
vim.notify(toCopy, vim.log.levels.INFO, { title = "Copied" })
|
vim.notify(toCopy, vim.log.levels.INFO, { title = "Copied" })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue