DEV Community

Discussion on: My Vim Story

Collapse
 
petr7555 profile image
Petr Janik

Hi, could you please explain what QuickfixToggle() is supposed to be used for?

Collapse
 
gaveen profile image
Gaveen Prabhasara

Vim has an inbuilt QuickFix window feature which can pop into view on errors, etc, sort of like in popular IDEs. This is sometimes used by filetype plugins as well. For example, if you run a compile action while on a file, the compiler errors could be displayed in the QuickFix window. Here's an outside link which shows it with a little more detail.

While it can be quite useful, it can be annoying if you have to open it manually too often (e.g., :copen or :cope) or if you have to go close it by typing in the relevant command (e.g., :cclose or :ccl).

Therefore, I wanted to map a keyboard shortcut which would toggle the QuickFix window. This is the action I have defined in the QuickfixToggle() function. It is later mapped to <leader>q.

Collapse
 
petr7555 profile image
Petr Janik

That's so cool! Thank you for a thorough explanation.