Skip to content

Commit

Permalink
feat(editing-support): add yanky.nvim (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfluegge authored Jul 29, 2023
1 parent fa830ef commit 299fe33
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/astrocommunity/editing-support/yanky-nvim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# yanky.nvim

Improved Yank and Put functionalities for Neovim.

**Repository:** <https://github.com/gbprod/yanky.nvim>
43 changes: 43 additions & 0 deletions lua/astrocommunity/editing-support/yanky-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -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["<c-p>"] = 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 = {
{
"<leader>p",
function() require("telescope").extensions.yank_history.yank_history {} end,
desc = "Open Yank History",
},
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank text" },
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" },
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" },
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" },
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" },
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle forward through yank history" },
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle backward through yank history" },
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" },
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" },
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" },
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" },
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put after applying a filter" },
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put before applying a filter" },
},
}

0 comments on commit 299fe33

Please sign in to comment.