add config var to always use system clipboard
parent
59945bc1c9
commit
a36ad301a5
11
README.md
11
README.md
|
|
@ -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 `"`.
|
- `.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`.
|
- `.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
|
### Disable Ex-Commands
|
||||||
Put this in your configuration file:
|
Put this in your configuration file:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ function M.moveSelectionToNewFile() fileOp("newFromSel") end
|
||||||
local function copyOp(operation)
|
local function copyOp(operation)
|
||||||
local reg = '"'
|
local reg = '"'
|
||||||
local clipboardOpt = vim.opt.clipboard:get()
|
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
|
if useSystemClipb then reg = "+" end
|
||||||
|
|
||||||
local toCopy = expand("%:p")
|
local toCopy = expand("%:p")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue