Skip to content

Commit 7c9b7f0

Browse files
committed
feat: Introduce lazy.nvim package spec - closes #109
1 parent bc691e8 commit 7c9b7f0

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

README.md

+7-15
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,8 @@ return {
6666
"andrewferrier/debugprint.nvim",
6767
opts = { … },
6868
dependencies = {
69-
"echasnovski/mini.nvim" -- Needed to enable :ToggleCommentDebugPrints for NeoVim 0.9
69+
"echasnovski/mini.nvim" -- Needed for :ToggleCommentDebugPrints (not needed for NeoVim 0.10+)
7070
},
71-
-- Remove the following line to use development versions,
72-
-- not just the formal releases
73-
version = "*"
7471
}
7572
```
7673

@@ -86,7 +83,7 @@ packer.startup(function(use)
8683
require("debugprint").setup(opts)
8784
end,
8885
requires = {
89-
"echasnovski/mini.nvim" -- Needed to enable :ToggleCommentDebugPrints for NeoVim 0.9
86+
"echasnovski/mini.nvim" -- Needed for :ToggleCommentDebugPrints (not needed for NeoVim 0.10+)
9087
}
9188
})
9289
@@ -157,22 +154,17 @@ return {
157154
},
158155
},
159156
-- The 'keys' and 'cmds' sections of this configuration are only needed if
160-
-- you want to take advantage of `lazy.nvim` lazy-loading.
157+
-- you want to take advantage of `lazy.nvim` lazy-loading - and you are
158+
-- *NOT* using lazy.nvim 0.11+, where they are enabled by default for the
159+
-- default keys and commands.
161160
keys = {
162-
{ "g?p", mode = 'n' },
163-
{ "g?P", mode = 'n' },
164-
{ "g?v", mode = 'n' },
165-
{ "g?V", mode = 'n' },
166-
{ "g?o", mode = 'n' },
167-
{ "g?O", mode = 'n' },
168-
{ "g?v", mode = 'x' },
169-
{ "g?V", mode = 'x' },
161+
{ "g?", mode = 'n' },
162+
{ "g?", mode = 'x' },
170163
},
171164
cmd = {
172165
"ToggleCommentDebugPrints",
173166
"DeleteDebugPrints",
174167
},
175-
version = "*"
176168
}
177169
```
178170

lazy.lua

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
local spec = {
2+
url = "https://github.com/andrewferrier/debugprint.nvim",
3+
opts = {},
4+
keys = {
5+
{ "g?", mode = "n" },
6+
{ "g?", mode = "x" },
7+
},
8+
cmd = {
9+
"ToggleCommentDebugPrints",
10+
"DeleteDebugPrints",
11+
},
12+
lazy = true,
13+
-- FIXME: Only introduce this line when we are about to release the next stable version otherwise this will cause a yo-yo effect
14+
-- Use stable versions by default
15+
-- version = '*',
16+
}
17+
18+
if vim.fn.has('nvim-0.10') == 0 then
19+
spec.dependencies = {
20+
"echasnovski/mini.nvim" -- Needed to enable :ToggleCommentDebugPrints for NeoVim 0.9
21+
}
22+
end
23+
24+
return spec

0 commit comments

Comments
 (0)