update: added osc52 toggle to nvim & added yadm readd

This commit is contained in:
2026-02-21 10:03:35 +03:00
parent 4f0a293fbb
commit 1dea8c1a69
4 changed files with 46 additions and 15 deletions

View File

@@ -2,3 +2,4 @@ require("config.lazy")
require("config.config")
require("config.options")
require("config.key_binds")
require("config.osc52")

View File

@@ -1,19 +1,4 @@
vim.opt.clipboard = "unnamedplus"
vim.g.clipboard = {
name = "osc 52",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
},
paste = {
["+"] = function()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end,
["*"] = function()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end,
},
}
vim.opt.fixeol = true

View File

@@ -0,0 +1,27 @@
vim.g.osc_enabled = false
vim.api.nvim_create_user_command("ToggleOsc", function(input)
if not vim.g.osc_enabled then
vim.g.clipboard = {
name = "osc 52",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
},
paste = {
["+"] = function()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end,
["*"] = function()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end,
},
}
vim.g.osc_enabled = true
vim.api.nvim_echo({ { "OSC 52 Clipboard Enabled", "Normal" } }, true, {})
else
vim.g.clipboard = nil
vim.g.osc_enabled = false
vim.api.nvim_echo({ { "OSC 52 Clipboard Disabled", "Normal" } }, true, {})
end
end, {})
vim.keymap.set("n", "<leader>H", vim.cmd.ToggleOsc, { desc = "Toggle OSC 52 clipboard" })

18
yadm-readd.sh Executable file
View File

@@ -0,0 +1,18 @@
yadm add ~/yadm-readd.sh
yadm add ~/.themes/Colloid-Transparent-Dracula/
yadm add ~/.config/nvim/
yadm add ~/.config/rofi/
yadm add ~/.config/yazi/
yadm add ~/.config/hypr/
yadm add ~/.config/waybar/
yadm add ~/.config/dunst/
yadm add ~/.config/kitty/
yadm add ~/.bash_profile
yadm add ~/.bashrc
yadm add ~/.bash_exports
yadm add ~/.bash_aliases
yadm add ~/.ideavimrc