mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-19 18:24:26 +02:00
feat(autocmds): added support for copy/paste through ssh. Needs Neovim >= 0.10.0
This commit is contained in:
parent
41e60af52c
commit
21ca466db1
1 changed files with 23 additions and 0 deletions
|
@ -113,3 +113,26 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
|||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Copy/Paste when using ssh on a remote server
|
||||
-- Only works on Neovim >= 0.10.0
|
||||
if vim.clipboard and vim.clipboard.osc52 then
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
group = augroup("ssh_clipboard"),
|
||||
callback = function()
|
||||
if vim.env.SSH_CONNECTION and vim.clipboard.osc52 then
|
||||
vim.g.clipboard = {
|
||||
name = "OSC 52",
|
||||
copy = {
|
||||
["+"] = require("vim.clipboard.osc52").copy,
|
||||
["*"] = require("vim.clipboard.osc52").copy,
|
||||
},
|
||||
paste = {
|
||||
["+"] = require("vim.clipboard.osc52").paste,
|
||||
["*"] = require("vim.clipboard.osc52").paste,
|
||||
},
|
||||
}
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue