The autoload command can be used to execute code depending on a range of events and filetypes.

When I list the active buffers, the buffer hosting the quickfix window has what seems to be a unique first and last char in the %a- tag... Not to mention, has the name "[Quickfix List]".

The task: I want to set a key binding that applies only to a quickfix window. I can accomplish the task based on the filetype.

The question: What is a robust approach to accomplish the same for a buffer in a quickfix window? i.e., have key bindings that only apply to the quickfix window.

Thank you in advance to anyone with ideas on how to proceed.

- E

  • 1
    I usually prefer ftplugins Commented Nov 17, 2020 at 17:38
  • I use a ftplugin to identify and sometimes augment what I do in a filetype-specific autocommand. Is there a way to use a ftplugin to identify quickfix? Commented Nov 17, 2020 at 17:53
  • 1
    The filetype is qf Commented Nov 17, 2020 at 18:07
  • 1
    @LucHermitte Exactly what I was looking for. Thank you! Commented Nov 17, 2020 at 20:02
  • 1
    Whilst your question has been answered for future reference you can use :set filetype? to query the current filetype, or indeed any option.
    – user32264
    Commented Nov 17, 2020 at 20:52

1 Answer 1


@LucHermitte provided the answer I was looking for.

Quickcheck has a filetype = qf.

Thank you!


  • 2
    Also make sure you use :map <buffer> for mappings relevant to a single buffer (or filetype, since filetype mappings are applied every time a buffer is set to that specific filetype.)
    – filbranden
    Commented Nov 17, 2020 at 22:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.