Skip to content

Commit bc99921

Browse files
refactor(lazydocker): replace keybindings table by function instead (#1204)
* feat(lazydocker): remove unnecesary default opts * refactor(lazydocker): replace opts table by function instead
1 parent 283ca3c commit bc99921

File tree

1 file changed

+12
-11
lines changed
  • lua/astrocommunity/docker/lazydocker

1 file changed

+12
-11
lines changed
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---@type LazySpec
12
return {
23
{
34
"mgierada/lazydocker.nvim",
@@ -6,18 +7,18 @@ return {
67
"akinsho/toggleterm.nvim",
78
{
89
"AstroNvim/astrocore",
9-
opts = {
10-
mappings = {
11-
n = {
12-
["<Leader>t" .. "d"] = {
13-
function() require("lazydocker").open() end,
14-
desc = "ToggleTerm LazyDocker",
15-
},
16-
},
17-
},
18-
},
10+
opts = function(_, opts)
11+
local maps = opts.mappings
12+
13+
-- INFO: Default prefix of toggleterm-related actions
14+
local prefix = "<Leader>t"
15+
16+
maps.n[prefix .. "d"] = {
17+
function() require("lazydocker").open() end,
18+
desc = "ToggleTerm LazyDocker",
19+
}
20+
end,
1921
},
2022
},
21-
opts = {},
2223
},
2324
}

0 commit comments

Comments
 (0)