summaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
authorLibravatar Mora Unie Youer <[email protected]>2025-05-08 11:02:18 +0300
committerLibravatar Mora Unie Youer <[email protected]>2025-05-08 11:02:18 +0300
commit6bde88b66d8c76a7d1d9e576f467cd5acede1033 (patch)
tree4d07e674db6e6ee1917be592f2f4b3dcf6aedc9d /lua/config
parentfeat: keybinds to copy/paste to/from clipboard easily (diff)
downloadneovim-configuration-6bde88b66d8c76a7d1d9e576f467cd5acede1033.tar.gz
neovim-configuration-6bde88b66d8c76a7d1d9e576f467cd5acede1033.tar.bz2
neovim-configuration-6bde88b66d8c76a7d1d9e576f467cd5acede1033.tar.lz
neovim-configuration-6bde88b66d8c76a7d1d9e576f467cd5acede1033.tar.xz
neovim-configuration-6bde88b66d8c76a7d1d9e576f467cd5acede1033.tar.zst
neovim-configuration-6bde88b66d8c76a7d1d9e576f467cd5acede1033.zip
feat: add `yanky.nvim`
Diffstat (limited to '')
-rw-r--r--lua/config/options.lua4
-rw-r--r--lua/config/plugins/extra.lua31
2 files changed, 31 insertions, 4 deletions
diff --git a/lua/config/options.lua b/lua/config/options.lua
index cf30af5..5a7be5d 100644
--- a/lua/config/options.lua
+++ b/lua/config/options.lua
@@ -59,7 +59,3 @@ map("n", "N", "Nzzzv", { desc = "Previous Search Result" })
-- Reset search highlight on ESC
map("n", "<Esc>", "<cmd>nohlsearch<CR>", { desc = "Reset search highlight" })
-
--- Copy and paste to/from clipboard
-map("n", "<leader>y", [["+y]], { desc = "Copy to clipboard" })
-map("n", "<leader>p", [["+p]], { desc = "Paste from clipboard" })
diff --git a/lua/config/plugins/extra.lua b/lua/config/plugins/extra.lua
index aba060b..4bbc381 100644
--- a/lua/config/plugins/extra.lua
+++ b/lua/config/plugins/extra.lua
@@ -1,5 +1,36 @@
return {
{
+ "yanky.nvim",
+ event = "DeferredUIEnter",
+ after = function(_)
+ require("yanky").setup({
+ highlight = { timer = 150 },
+ system_clipboard = {
+ sync_with_ring = true,
+ },
+ })
+ end,
+ keys = {
+ { "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
+ { "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Text After Cursor" },
+ { "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Cursor" },
+ { "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Text After Selection" },
+ { "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put 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" },
+ },
+ },
+ {
"which-key.nvim",
event = "DeferredUIEnter",
after = function(_)