♻️ refactor(nvim): make yanky an extra module that imports the lazyvim one and my options
This commit is contained in:
parent
3ea3119a2e
commit
1a64536c8f
3 changed files with 40 additions and 34 deletions
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"extras": [
|
"extras": [
|
||||||
"lazyvim.plugins.extras.coding.yanky",
|
|
||||||
"lazyvim.plugins.extras.formatting.black",
|
"lazyvim.plugins.extras.formatting.black",
|
||||||
"lazyvim.plugins.extras.lang.python-semshi",
|
"lazyvim.plugins.extras.lang.python-semshi",
|
||||||
"lazyvim.plugins.extras.lang.yaml",
|
"lazyvim.plugins.extras.lang.yaml",
|
||||||
|
@ -18,6 +17,7 @@
|
||||||
"plugins.extras.coding.treesitter.node-action",
|
"plugins.extras.coding.treesitter.node-action",
|
||||||
"plugins.extras.coding.treesitter.puppeteer",
|
"plugins.extras.coding.treesitter.puppeteer",
|
||||||
"plugins.extras.coding.treesitter.text-case",
|
"plugins.extras.coding.treesitter.text-case",
|
||||||
|
"plugins.extras.coding.yanky",
|
||||||
"plugins.extras.dap.core",
|
"plugins.extras.dap.core",
|
||||||
"plugins.extras.dap.persistent-breakpoints",
|
"plugins.extras.dap.persistent-breakpoints",
|
||||||
"plugins.extras.editor.color",
|
"plugins.extras.editor.color",
|
||||||
|
|
39
.config/nvim/lua/plugins/extras/coding/yanky.lua
Normal file
39
.config/nvim/lua/plugins/extras/coding/yanky.lua
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
import = "lazyvim.plugins.extras.coding.yanky",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gbprod/yanky.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local utils = require("yanky.utils")
|
||||||
|
local mapping = require("yanky.telescope.mapping")
|
||||||
|
|
||||||
|
opts.highlight = { timer = 250 }
|
||||||
|
opts.ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" }
|
||||||
|
opts.picker = {
|
||||||
|
telescope = {
|
||||||
|
use_default_mappings = false,
|
||||||
|
mappings = {
|
||||||
|
default = mapping.put("p"),
|
||||||
|
i = {
|
||||||
|
["<c-g>"] = mapping.put("p"),
|
||||||
|
["<c-h>"] = mapping.put("P"),
|
||||||
|
["<c-x>"] = mapping.delete(),
|
||||||
|
["<c-r>"] = mapping.set_register(utils.get_default_register()),
|
||||||
|
},
|
||||||
|
n = {
|
||||||
|
p = mapping.put("p"),
|
||||||
|
P = mapping.put("P"),
|
||||||
|
d = mapping.delete(),
|
||||||
|
r = mapping.set_register(utils.get_default_register()),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{"<leader>sy", function() require("telescope").extensions.yank_history.yank_history({}) end, mode = {"n", "v"}, desc = "Yank History"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,33 +0,0 @@
|
||||||
local utils = require("yanky.utils")
|
|
||||||
local mapping = require("yanky.telescope.mapping")
|
|
||||||
|
|
||||||
return {
|
|
||||||
"gbprod/yanky.nvim",
|
|
||||||
optional = true,
|
|
||||||
opts = {
|
|
||||||
picker = {
|
|
||||||
telescope = {
|
|
||||||
use_default_mappings = false,
|
|
||||||
mappings = {
|
|
||||||
default = mapping.put("p"),
|
|
||||||
i = {
|
|
||||||
["<c-g>"] = mapping.put("p"),
|
|
||||||
["<c-h>"] = mapping.put("P"),
|
|
||||||
["<c-x>"] = mapping.delete(),
|
|
||||||
["<c-r>"] = mapping.set_register(utils.get_default_register()),
|
|
||||||
},
|
|
||||||
n = {
|
|
||||||
p = mapping.put("p"),
|
|
||||||
P = mapping.put("P"),
|
|
||||||
d = mapping.delete(),
|
|
||||||
r = mapping.set_register(utils.get_default_register()),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- stylua: ignore
|
|
||||||
keys = {
|
|
||||||
{"<leader>sy", function() require("telescope").extensions.yank_history.yank_history({}) end, mode = {"n", "v"}, desc = "Yank History"},
|
|
||||||
},
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue