-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(editing-support): add yanky.nvim (#486)
- Loading branch information
1 parent
fa830ef
commit 299fe33
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" }, | ||
}, | ||
} |