mirror of
https://github.com/gyoder/dots.git
synced 2026-02-27 17:03:45 +00:00
nvim/tmux: added OSC52 copy and paste support for remote ssh sessions
This commit is contained in:
parent
dc21944ad2
commit
23363f30d2
2 changed files with 32 additions and 3 deletions
|
|
@ -3,7 +3,7 @@ set-environment -g TMUX_POWERLINE_THEME bubble
|
||||||
# Options
|
# Options
|
||||||
set -g mouse on
|
set -g mouse on
|
||||||
set -g default-terminal "screen-256color"
|
set -g default-terminal "screen-256color"
|
||||||
set-option -sa terminal-overrides ',xterm-256color:Tc'
|
set-option -sa terminal-overrides ',xterm-256color:Tc,xterm-*:allow-passthrough'
|
||||||
set-window-option -g mode-keys vi
|
set-window-option -g mode-keys vi
|
||||||
set -g status-position top
|
set -g status-position top
|
||||||
set-option -g set-clipboard on
|
set-option -g set-clipboard on
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,39 @@ if vim.g.is_purdue then
|
||||||
vim.cmd("set noundofile") -- i forgor how to do this in lua so i didnt
|
vim.cmd("set noundofile") -- i forgor how to do this in lua so i didnt
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- vim.opt.spell = true
|
||||||
|
-- vim.opt.spelllang = "en_us"
|
||||||
|
--
|
||||||
|
|
||||||
vim.opt.spell = true
|
-- For init.lua
|
||||||
vim.opt.spelllang = "en_us"
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "markdown",
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.textwidth = 80
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.o.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank()
|
||||||
|
local osc52 = require("vim.ui.clipboard.osc52")
|
||||||
|
local contents = vim.v.event.regcontents
|
||||||
|
local regtype = vim.v.event.regtype
|
||||||
|
|
||||||
|
if type(contents) == "string" then
|
||||||
|
contents = { contents }
|
||||||
|
end
|
||||||
|
|
||||||
|
if regtype == "V" then
|
||||||
|
for i, line in ipairs(contents) do
|
||||||
|
contents[i] = line .. "\n"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
osc52.copy("+")(contents)
|
||||||
|
osc52.copy("*")(contents)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue