add repolink and osc52 support just for copying

This commit is contained in:
Andy Teijelo 2024-06-19 16:45:33 -04:00
parent fde7281e01
commit dd079bb9f9
3 changed files with 28 additions and 0 deletions

View file

@ -88,6 +88,9 @@ function vim.getVisualSelection()
end end
end end
keymap("n", "<leader>ghl", "<cmd>RepoLink<CR>", opts)
keymap("x", "<leader>ghl", ":RepoLink<CR>", opts)
keymap("v", "<space>sw", function() keymap("v", "<space>sw", function()
local tb = require("telescope.builtin") local tb = require("telescope.builtin")
local text = vim.getVisualSelection() local text = vim.getVisualSelection()

View file

@ -15,3 +15,19 @@ vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldenable = false vim.opt.foldenable = false
vim.opt.exrc = true vim.opt.exrc = true
function no_paste(reg)
return function(lines)
end
end
vim.g.clipboard = {
name = 'OSC 52',
copy = {
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
},
paste = {
['+'] = no_paste('+'),
['*'] = no_paste('*'),
},
}

9
lua/plugins/repolink.lua Normal file
View file

@ -0,0 +1,9 @@
return {
{
"9seconds/repolink.nvim",
opts = {
use_full_commit_hash = true,
bang_register = "+",
}
},
}