File tree 4 files changed +61
-7
lines changed
4 files changed +61
-7
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,31 @@ return {
327
327
task = " ✔ " ,
328
328
},
329
329
throttle = 20 , -- how frequently should the ui process render events
330
+ custom_keys = {
331
+ -- you can define custom key maps here.
332
+ -- To disable one of the defaults, set it to false
333
+
334
+ -- open lazygit log
335
+ [" <localleader>l" ] = function (plugin )
336
+ require (" lazy.util" ).open_cmd ({ " lazygit" , " log" }, {
337
+ cwd = plugin .dir ,
338
+ terminal = true ,
339
+ close_on_exit = true ,
340
+ enter = true ,
341
+ })
342
+ end ,
343
+
344
+ -- open a terminal for the plugin dir
345
+ [" <localleader>t" ] = function (plugin )
346
+ require (" lazy.util" ).open_cmd ({ vim .go .shell }, {
347
+ cwd = plugin .dir ,
348
+ terminal = true ,
349
+ close_on_exit = true ,
350
+ enter = true ,
351
+ })
352
+ end ,
353
+ },
354
+ },
330
355
diff = {
331
356
-- diff command <d> can be one of:
332
357
-- * browser: opens the github compare view. Note that this is always mapped to <K> as well,
Original file line number Diff line number Diff line change 1
- ## ✅ TODO
1
+ # ✅ TODO
2
2
3
3
- [x] fancy UI to manage all your Neovim plugins
4
4
- [x] auto lazy-loading of lua modules
46
46
47
47
- [ ] document highlight groups
48
48
- [ ] document user events
49
+ - [ ] document API, like lazy.plugins()
50
+ - [ ] icons
49
51
50
52
- [x] check in cache if rtp files match
51
53
- [x] I think the installation section, specifically the loading part, could use an
Original file line number Diff line number Diff line change @@ -50,6 +50,31 @@ M.defaults = {
50
50
task = " ✔ " ,
51
51
},
52
52
throttle = 20 , -- how frequently should the ui process render events
53
+ custom_keys = {
54
+ -- you can define custom key maps here.
55
+ -- To disable one of the defaults, set it to false
56
+
57
+ -- open lazygit log
58
+ [" <localleader>l" ] = function (plugin )
59
+ require (" lazy.util" ).open_cmd ({ " lazygit" , " log" }, {
60
+ cwd = plugin .dir ,
61
+ terminal = true ,
62
+ close_on_exit = true ,
63
+ enter = true ,
64
+ })
65
+ end ,
66
+
67
+ -- open a terminal for the plugin dir
68
+ [" <localleader>t" ] = function (plugin )
69
+ require (" lazy.util" ).open_cmd ({ vim .go .shell }, {
70
+ cwd = plugin .dir ,
71
+ terminal = true ,
72
+ close_on_exit = true ,
73
+ enter = true ,
74
+ })
75
+ end ,
76
+ },
77
+ },
53
78
diff = {
54
79
-- diff command <d> can be one of:
55
80
-- * browser: opens the github compare view. Note that this is always mapped to <K> as well,
Original file line number Diff line number Diff line change @@ -96,12 +96,14 @@ function M.create(opts)
96
96
end )
97
97
98
98
for key , handler in pairs (Config .options .ui .custom_keys ) do
99
- self :on_key (key , function ()
100
- local plugin = self .render :get_plugin ()
101
- if plugin then
102
- handler (plugin )
103
- end
104
- end )
99
+ if handler then
100
+ self :on_key (key , function ()
101
+ local plugin = self .render :get_plugin ()
102
+ if plugin then
103
+ handler (plugin )
104
+ end
105
+ end )
106
+ end
105
107
end
106
108
107
109
self :setup_patterns ()
You can’t perform that action at this time.
0 commit comments