(feat): add osc52 support
This commit is contained in:
parent
ff50325ade
commit
e08ef74fa4
4 changed files with 43 additions and 1 deletions
27
.config/nvim/lua/bumpsoo/plugins/osc_yank.lua
Normal file
27
.config/nvim/lua/bumpsoo/plugins/osc_yank.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
'ojroques/vim-oscyank',
|
||||
config = function()
|
||||
local valid_registers = {
|
||||
[''] = true,
|
||||
['+'] = true,
|
||||
['*'] = true,
|
||||
}
|
||||
|
||||
local valid_operators = {
|
||||
['y'] = true,
|
||||
['d'] = true,
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
local regname = vim.v.event.regname
|
||||
local operator = vim.v.event.operator
|
||||
|
||||
if valid_registers[regname] and valid_operators[operator] then
|
||||
vim.fn.OSCYankRegister(regname)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue