nvim: init: Use OSC 52 for copying to system clipboard in SSH session

This commit is contained in:
Sanchayan Maity 2023-11-27 17:53:29 +05:30
parent 1d3169af1e
commit 556afeabcc
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -69,8 +69,22 @@ vim.g.dispatch_no_maps = 1
vim.g.matchup_matchparen_offscreen = {} vim.g.matchup_matchparen_offscreen = {}
vim.g.matchup_surround_enabled = 1 vim.g.matchup_surround_enabled = 1
-- See :help clipboard and https://github.com/neovim/neovim/issues/14545 if os.getenv("SSH_CONNECTION") then
vim.g.clipboard = { 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", name = "clipboard",
copy = { copy = {
["+"] = "wl-copy", ["+"] = "wl-copy",
@ -81,7 +95,8 @@ vim.g.clipboard = {
["*"] = "wl-paste" ["*"] = "wl-paste"
}, },
cache_enabled = true cache_enabled = true
} }
end
-- No default mappings for tmux navigator -- No default mappings for tmux navigator
vim.g.tmux_navigator_no_mappings = 1 vim.g.tmux_navigator_no_mappings = 1