added yanky

This commit is contained in:
Oliver Hartmann 2022-04-20 22:49:07 +02:00
parent 2c4617f462
commit 7bd0f10847
3 changed files with 16 additions and 7 deletions

View File

@ -172,6 +172,10 @@ return require('packer').startup(function()
requires = { 'nvim-telescope/telescope.nvim' },
config = get_setup('my_command_center'),
})
use({
'gbprod/yanky.nvim',
config = get_setup('yanky')
})
if packer_bootstrap then
require('packer').sync()
end

View File

@ -82,13 +82,6 @@ command_center.add({
{ 'n', '<leader>f', silent_noremap },
},
},
{
description = 'Find file (with gitignore)',
cmd = '<CMD>lua require("telescope.builtin").find_files({no_ignore=false})<CR>',
keybindings = {
{ 'n', '<C-p>', silent_noremap },
},
},
{
description = 'Find git files',
cmd = '<CMD>Telescope git_files<CR>',

12
lua/setup/yanky.lua Normal file
View File

@ -0,0 +1,12 @@
require('yanky').setup()
vim.api.nvim_set_keymap('n', 'p', '<Plug>(YankyPutAfter)', {})
vim.api.nvim_set_keymap('n', 'P', '<Plug>(YankyPutBefore)', {})
vim.api.nvim_set_keymap('x', 'p', '<Plug>(YankyPutAfter)', {})
vim.api.nvim_set_keymap('x', 'P', '<Plug>(YankyPutBefore)', {})
vim.api.nvim_set_keymap('n', 'gp', '<Plug>(YankyGPutAfter)', {})
vim.api.nvim_set_keymap('n', 'gP', '<Plug>(YankyGPutBefore)', {})
vim.api.nvim_set_keymap('x', 'gp', '<Plug>(YankyGPutAfter)', {})
vim.api.nvim_set_keymap('x', 'gP', '<Plug>(YankyGPutBefore)', {})
vim.api.nvim_set_keymap("n", "<c-n>", "<Plug>(YankyCycleForward)", {})
vim.api.nvim_set_keymap("n", "<c-p>", "<Plug>(YankyCycleBackward)", {})