feat: yanky.nvim

This commit is contained in:
punkfairie 2025-01-01 16:58:35 -08:00
parent e8f75bb299
commit b7dfb32623
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
3 changed files with 106 additions and 0 deletions

View file

@ -101,6 +101,7 @@ with final.pkgs.lib; let
mini-comment
mini-ai
mini-surround
yanky-nvim
# Formatting
conform-nvim

View file

@ -10,4 +10,5 @@ return {
req('mini-surround'),
req('neotab-nvim'),
req('ts-comments-nvim'),
req('yanky-nvim'),
}

View file

@ -0,0 +1,104 @@
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,
}