3
submitted 1 year ago* (last edited 1 year ago) by dafunkkk@lemmy.world to c/neovim@programming.dev

As title, I'v installed mini.comment plugin, but when I type gc for commenting a line nothing happen. How can I know what's wrong without disable every other extension or proceding incrementaly from scratch? (don't want to intterrupt my workflow) Thanks

top 5 comments
sorted by: hot top controversial new old
[-] skipperwannabe@lemm.ee 2 points 1 year ago

Try using :verbose nmap gc to find out what the shortcut is currently mapped to.

I don't use mini.comment, but I assume it needs an operator after gc to for commenting. I have seen gcc used to comment out the line. Just wanted to make sure you are using the correct mapping.

[-] dafunkkk@lemmy.world 1 points 1 year ago* (last edited 1 year ago)

This is what is showed after doing :verbose namp gc, seems that all is ok....still if I press gc // on commentig line a search command is done...if I try on commented line with gcc command the line is cleared...

n g * lua require("which-key").show("g", {mode = "n", auto = true}) Last set from Lua

n gcc * Comment line Last set from Lua line 293

n gc * Comment Last set from Lua line 293

[-] skipperwannabe@lemm.ee 1 points 1 year ago

Like I said, I haven't used mini.comment, but having both gc and gcc mapping may cause problems. If I remember correctly, in these situations, neovim waits after receiving gc command to figure out if you are trying to execute comment last or gcc with comment line. Depending on timelen (or timeout, forgot the exact name) setting the command you actually execute will defer based on the key pressed/not pressed after gc.

Also, if gc is mapped to comment last, and there was no last comment action performed, it might do nothing (maybe check the readme to be sure). So maybe try changing the mapping to see if that helps.

[-] dafunkkk@lemmy.world 1 points 1 year ago

it seems that which-key create conflict with mini.commnet...if I disable it gc and gcc works according....now I don't know how to let both plugin live togethere

[-] skipperwannabe@lemm.ee 1 points 1 year ago

That makes sense. Which-key doesn't allow the timeout to take place after gc since it knows about gcc. While that functionality is useful when you don't know which key to press next, in situations like these it would create problems. I think your best solution would still be to modify the mappings. Maybe remap gc to gcl (comment last) or something like that.

this post was submitted on 22 Nov 2023
3 points (100.0% liked)

Neovim

2161 readers
3 users here now

founded 1 year ago
MODERATORS