From dd079bb9f92071180857ad3883a138e55b475e4e Mon Sep 17 00:00:00 2001 From: Andy Teijelo Date: Wed, 19 Jun 2024 16:45:33 -0400 Subject: [PATCH] add repolink and osc52 support just for copying --- lua/config/keymaps.lua | 3 +++ lua/config/options.lua | 16 ++++++++++++++++ lua/plugins/repolink.lua | 9 +++++++++ 3 files changed, 28 insertions(+) create mode 100644 lua/plugins/repolink.lua diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 9cc1ac3..44a37ed 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -88,6 +88,9 @@ function vim.getVisualSelection() end end +keymap("n", "ghl", "RepoLink", opts) +keymap("x", "ghl", ":RepoLink", opts) + keymap("v", "sw", function() local tb = require("telescope.builtin") local text = vim.getVisualSelection() diff --git a/lua/config/options.lua b/lua/config/options.lua index 217a83f..5e87184 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -15,3 +15,19 @@ vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldenable = false 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('*'), + }, +} diff --git a/lua/plugins/repolink.lua b/lua/plugins/repolink.lua new file mode 100644 index 0000000..5d0cb52 --- /dev/null +++ b/lua/plugins/repolink.lua @@ -0,0 +1,9 @@ +return { + { + "9seconds/repolink.nvim", + opts = { + use_full_commit_hash = true, + bang_register = "+", + } + }, +}