add config var to always use system clipboard

remotes/origin/HEAD
Ofir Gal 2023-09-05 11:11:01 +03:00
parent 59945bc1c9
commit a36ad301a5
2 changed files with 12 additions and 1 deletions

View File

@ -68,6 +68,17 @@ The following applies to all commands above:
- `.copyFilepath` or `:CopyFilepath`: Copy the absolute file path. When `clipboard="unnamed[plus]"` has been set, copies to the `+` register, otherwise to `"`.
- `.chmodx` or `:Chmodx`: Makes current file executable. Equivalent to `chmod +x`.
To always use system clipboard put this in your configuration file:
```lua
-- lua
vim.g.genghis_use_systemclipboard = true
```
```vim
-- viml
let g:genghis_use_systemclipboard = v:true
```
### Disable Ex-Commands
Put this in your configuration file:

View File

@ -155,7 +155,7 @@ function M.moveSelectionToNewFile() fileOp("newFromSel") end
local function copyOp(operation)
local reg = '"'
local clipboardOpt = vim.opt.clipboard:get()
local useSystemClipb = #clipboardOpt > 0 and clipboardOpt[1]:find("unnamed")
local useSystemClipb = vim.g.genghis_use_systemclipboard or (#clipboardOpt > 0 and clipboardOpt[1]:find("unnamed"))
if useSystemClipb then reg = "+" end
local toCopy = expand("%:p")