diff --git a/lua/astrocommunity/editing-support/yanky-nvim/README.md b/lua/astrocommunity/editing-support/yanky-nvim/README.md new file mode 100644 index 000000000..4a8565b80 --- /dev/null +++ b/lua/astrocommunity/editing-support/yanky-nvim/README.md @@ -0,0 +1,5 @@ +# yanky.nvim + +Improved Yank and Put functionalities for Neovim. + +**Repository:** diff --git a/lua/astrocommunity/editing-support/yanky-nvim/init.lua b/lua/astrocommunity/editing-support/yanky-nvim/init.lua new file mode 100644 index 000000000..6acec13ec --- /dev/null +++ b/lua/astrocommunity/editing-support/yanky-nvim/init.lua @@ -0,0 +1,43 @@ +return { + "gbprod/yanky.nvim", + dependencies = { { "kkharji/sqlite.lua", enabled = not jit.os:find "Windows" } }, + opts = function() + local mapping = require "yanky.telescope.mapping" + local mappings = mapping.get_defaults() + mappings.i[""] = nil + return { + highlight = { timer = 200 }, + ring = { storage = jit.os:find "Windows" and "shada" or "sqlite" }, + picker = { + telescope = { + use_default_mappings = false, + mappings = mappings, + }, + }, + } + end, + keys = { + { + "p", + function() require("telescope").extensions.yank_history.yank_history {} end, + desc = "Open Yank History", + }, + { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank text" }, + { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" }, + { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" }, + { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" }, + { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" }, + { "[y", "(YankyCycleForward)", desc = "Cycle forward through yank history" }, + { "]y", "(YankyCycleBackward)", desc = "Cycle backward through yank history" }, + { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" }, + { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" }, + { "]P", "(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" }, + { "[P", "(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" }, + { ">p", "(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" }, + { "(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" }, + { ">P", "(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" }, + { "(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" }, + { "=p", "(YankyPutAfterFilter)", desc = "Put after applying a filter" }, + { "=P", "(YankyPutBeforeFilter)", desc = "Put before applying a filter" }, + }, +}