🐛 fix(nvim): yanky options to support fzf-lua

This commit is contained in:
Sergio Laín 2025-01-07 23:55:04 +01:00
parent d46545e9bd
commit b7eb46e0cf
No known key found for this signature in database
GPG key ID: 51BB28D8B42FB438

View file

@ -5,10 +5,11 @@ return {
{ {
"gbprod/yanky.nvim", "gbprod/yanky.nvim",
opts = function(_, opts) opts = function(_, opts)
opts.highlight = { timer = 250 }
if LazyVim.has("telescope.nvim") then
local utils = require("yanky.utils") local utils = require("yanky.utils")
local mapping = require("yanky.telescope.mapping") local mapping = require("yanky.telescope.mapping")
opts.highlight = { timer = 250 }
opts.picker = { opts.picker = {
telescope = { telescope = {
use_default_mappings = false, use_default_mappings = false,
@ -29,14 +30,14 @@ return {
}, },
}, },
} }
end
end, end,
keys = { keys = {
{ {
"<leader>sy", "<leader>sy",
function() function()
local ok, telescope = pcall(require, "telescope") if LazyVim.pick.picker.name == "telescope" then
if ok then require("telescope").extensions.yank_history.yank_history({})
telescope.extensions.yank_history.yank_history({})
else else
vim.cmd([[YankyRingHistory]]) vim.cmd([[YankyRingHistory]])
end end