@@ -248,44 +248,109 @@ function api.setup(config)
248
248
' n' ,
249
249
cfg .toggler .line ,
250
250
" v:count == 0 ? '<Plug>(comment_toggle_current_linewise)' : '<Plug>(comment_toggle_linewise_count)'" ,
251
- { expr = true , remap = true , replace_keycodes = false }
251
+ { expr = true , remap = true , replace_keycodes = false , desc = ' Comment toggle current line ' }
252
252
)
253
253
K (
254
254
' n' ,
255
255
cfg .toggler .block ,
256
256
" v:count == 0 ? '<Plug>(comment_toggle_current_blockwise)' : '<Plug>(comment_toggle_blockwise_count)'" ,
257
- { expr = true , remap = true , replace_keycodes = false }
257
+ { expr = true , remap = true , replace_keycodes = false , desc = ' Comment toggle current block ' }
258
258
)
259
259
260
- K (' n' , cfg .opleader .line , ' <Plug>(comment_toggle_linewise)' )
261
- K (' n' , cfg .opleader .block , ' <Plug>(comment_toggle_blockwise)' )
260
+ K (' n' , cfg .opleader .line , ' <Plug>(comment_toggle_linewise)' , { desc = ' Comment toggle linewise ' } )
261
+ K (' n' , cfg .opleader .block , ' <Plug>(comment_toggle_blockwise)' , { desc = ' Comment toggle blockwise ' } )
262
262
263
263
-- VISUAL mode mappings
264
- K (' x' , cfg .opleader .line , ' <Plug>(comment_toggle_linewise_visual)' )
265
- K (' x' , cfg .opleader .block , ' <Plug>(comment_toggle_blockwise_visual)' )
264
+ K (
265
+ ' x' ,
266
+ cfg .opleader .line ,
267
+ ' <Plug>(comment_toggle_linewise_visual)' ,
268
+ { desc = ' Comment toggle linewise (visual)' }
269
+ )
270
+ K (
271
+ ' x' ,
272
+ cfg .opleader .block ,
273
+ ' <Plug>(comment_toggle_blockwise_visual)' ,
274
+ { desc = ' Comment toggle blockwise (visual)' }
275
+ )
266
276
end
267
277
268
278
-- Extra Mappings
269
279
if cfg .mappings .extra then
270
- K (' n' , cfg .extra .below , ' <CMD>lua require("Comment.api").locked.insert_linewise_below()<CR>' )
271
- K (' n' , cfg .extra .above , ' <CMD>lua require("Comment.api").locked.insert_linewise_above()<CR>' )
272
- K (' n' , cfg .extra .eol , ' <CMD>lua require("Comment.api").locked.insert_linewise_eol()<CR>' )
280
+ K (
281
+ ' n' ,
282
+ cfg .extra .below ,
283
+ ' <CMD>lua require("Comment.api").locked.insert_linewise_below()<CR>' ,
284
+ { desc = ' Comment insert below' }
285
+ )
286
+ K (
287
+ ' n' ,
288
+ cfg .extra .above ,
289
+ ' <CMD>lua require("Comment.api").locked.insert_linewise_above()<CR>' ,
290
+ { desc = ' Comment insert above' }
291
+ )
292
+ K (
293
+ ' n' ,
294
+ cfg .extra .eol ,
295
+ ' <CMD>lua require("Comment.api").locked.insert_linewise_eol()<CR>' ,
296
+ { desc = ' Comment insert end of line' }
297
+ )
273
298
end
274
299
275
300
-- Extended Mappings
276
301
if cfg .mappings .extended then
277
302
-- NORMAL mode extended
278
- K (' n' , ' g>' , ' <CMD>lua require("Comment.api").call("comment_linewise_op")<CR>g@' )
279
- K (' n' , ' g>c' , ' <CMD>lua require("Comment.api").call("comment_current_linewise_op")<CR>g@$' )
280
- K (' n' , ' g>b' , ' <CMD>lua require("Comment.api").call("comment_current_blockwise_op")<CR>g@$' )
303
+ K (
304
+ ' n' ,
305
+ ' g>' ,
306
+ ' <CMD>lua require("Comment.api").call("comment_linewise_op")<CR>g@' ,
307
+ { desc = ' Comment region linewise' }
308
+ )
309
+ K (
310
+ ' n' ,
311
+ ' g>c' ,
312
+ ' <CMD>lua require("Comment.api").call("comment_current_linewise_op")<CR>g@$' ,
313
+ { desc = ' Comment current line' }
314
+ )
315
+ K (
316
+ ' n' ,
317
+ ' g>b' ,
318
+ ' <CMD>lua require("Comment.api").call("comment_current_blockwise_op")<CR>g@$' ,
319
+ { desc = ' Comment current block' }
320
+ )
281
321
282
- K (' n' , ' g<' , ' <CMD>lua require("Comment.api").call("uncomment_linewise_op")<CR>g@' )
283
- K (' n' , ' g<c' , ' <CMD>lua require("Comment.api").call("uncomment_current_linewise_op")<CR>g@$' )
284
- K (' n' , ' g<b' , ' <CMD>lua require("Comment.api").call("uncomment_current_blockwise_op")<CR>g@$' )
322
+ K (
323
+ ' n' ,
324
+ ' g<' ,
325
+ ' <CMD>lua require("Comment.api").call("uncomment_linewise_op")<CR>g@' ,
326
+ { desc = ' Uncomment region linewise' }
327
+ )
328
+ K (
329
+ ' n' ,
330
+ ' g<c' ,
331
+ ' <CMD>lua require("Comment.api").call("uncomment_current_linewise_op")<CR>g@$' ,
332
+ { desc = ' Uncomment current line' }
333
+ )
334
+ K (
335
+ ' n' ,
336
+ ' g<b' ,
337
+ ' <CMD>lua require("Comment.api").call("uncomment_current_blockwise_op")<CR>g@$' ,
338
+ { desc = ' Uncomment current block' }
339
+ )
285
340
286
341
-- VISUAL mode extended
287
- K (' x' , ' g>' , ' <ESC><CMD>lua require("Comment.api").locked.comment_linewise_op(vim.fn.visualmode())<CR>' )
288
- K (' x' , ' g<' , ' <ESC><CMD>lua require("Comment.api").locked.uncomment_linewise_op(vim.fn.visualmode())<CR>' )
342
+ K (
343
+ ' x' ,
344
+ ' g>' ,
345
+ ' <ESC><CMD>lua require("Comment.api").locked.comment_linewise_op(vim.fn.visualmode())<CR>' ,
346
+ { desc = ' Comment region linewise (visual)' }
347
+ )
348
+ K (
349
+ ' x' ,
350
+ ' g<' ,
351
+ ' <ESC><CMD>lua require("Comment.api").locked.uncomment_linewise_op(vim.fn.visualmode())<CR>' ,
352
+ { desc = ' Uncomment region linewise (visual)' }
353
+ )
289
354
end
290
355
end
291
356
0 commit comments