marleyvim/nvim/lua/plugins/coding/yanky-nvim.lua
2025-01-01 16:58:35 -08:00

104 lines
2.2 KiB
Lua

return {
'yanky.nvim',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
keys = {
{
'gp',
'<PLUG>(YankyGPutAfter)',
mode = { 'n', 'x' },
desc = 'put text after selection',
},
{
'gP',
'<PLUG>(YankyGPutBefore',
mode = { 'n', 'x' },
desc = 'put text before selection',
},
{
'p',
'<PLUG>(YankyPutAfter)',
mode = { 'n', 'x' },
desc = 'put text after cursor',
},
{
'P',
'<PLUG>(YankyPutBefore)',
mode = { 'n', 'x' },
desc = 'put text before cursor',
},
{ 'y', '<PLUG>(YankyYank)', mode = { 'n', 'x' }, desc = 'yank text' },
{
'<LEADER>p',
function()
vim.cmd([[YankyRingHistory]])
end,
mode = { 'n', 'x' },
desc = 'open yank history',
},
{
'[p',
'<PLUG>(YankyPutIndentBeforeLinewise)',
desc = 'put indented before cursor (linewise)',
},
{
'[P',
'<PLUG>(YankyPutIndentBeforeLinewise)',
desc = 'put indented before cursor (linewise)',
},
{
']p',
'<PLUG>(YankyPutIndentAfterLinewise)',
desc = 'put indented after cursor (linewise)',
},
{
']P',
'<PLUG>(YankyPutIndentAfterLinewise)',
desc = 'put indented after cursor (linewise)',
},
{
'[y',
'<PLUG>(YankyCycleForward)',
desc = 'cycle forward through yank history',
},
{
']y',
'<PLUG>(YankyCycleBackward)',
desc = 'cycle backword through yank history',
},
{
'<p',
'<PLUG>(YankyPutIndentAfterShiftLeft)',
desc = 'put and indent left',
},
{
'<P',
'<PLUG>(YankyPutIndentBeforeShiftLeft)',
desc = 'put and indent left',
},
{
'>p',
'<PLUG>(YankyPutIndentAfterShiftRight)',
desc = 'put and indent right',
},
{
'>P',
'<PLUG>(YankyPutIndentBeforeShiftRight)',
desc = 'put and indent right',
},
{
'=p',
'<PLUG>(YankyPutAfterFilter)',
desc = 'put after applying a filter',
},
{
'=P',
'<PLUG>(YankyPutBeforeFilter)',
desc = 'put before applying a filter',
},
},
after = function()
require('yanky').setup({
highlight = { timer = 150 },
})
end,
}