nvim: init: Use OSC 52 for copying to system clipboard in SSH session
This commit is contained in:
parent
1d3169af1e
commit
556afeabcc
1 changed files with 28 additions and 13 deletions
|
@ -69,19 +69,34 @@ vim.g.dispatch_no_maps = 1
|
|||
vim.g.matchup_matchparen_offscreen = {}
|
||||
vim.g.matchup_surround_enabled = 1
|
||||
|
||||
-- See :help clipboard and https://github.com/neovim/neovim/issues/14545
|
||||
vim.g.clipboard = {
|
||||
name = "clipboard",
|
||||
copy = {
|
||||
["+"] = "wl-copy",
|
||||
["*"] = "wl-copy"
|
||||
},
|
||||
paste = {
|
||||
["+"] = "wl-paste",
|
||||
["*"] = "wl-paste"
|
||||
},
|
||||
cache_enabled = true
|
||||
}
|
||||
if os.getenv("SSH_CONNECTION") then
|
||||
local osc52 = require('vim.ui.clipboard.osc52')
|
||||
vim.g.clipboard = {
|
||||
name = 'OSC 52',
|
||||
copy = {
|
||||
['+'] = osc52.copy,
|
||||
['*'] = osc52.copy,
|
||||
},
|
||||
paste = {
|
||||
['+'] = osc52.paste,
|
||||
['*'] = osc52.paste,
|
||||
},
|
||||
}
|
||||
else
|
||||
-- See :help clipboard and https://github.com/neovim/neovim/issues/14545
|
||||
vim.g.clipboard = {
|
||||
name = "clipboard",
|
||||
copy = {
|
||||
["+"] = "wl-copy",
|
||||
["*"] = "wl-copy"
|
||||
},
|
||||
paste = {
|
||||
["+"] = "wl-paste",
|
||||
["*"] = "wl-paste"
|
||||
},
|
||||
cache_enabled = true
|
||||
}
|
||||
end
|
||||
|
||||
-- No default mappings for tmux navigator
|
||||
vim.g.tmux_navigator_no_mappings = 1
|
||||
|
|
Loading…
Reference in a new issue