1

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

6
  • 1
    I usually prefer ftplugins Nov 17 '20 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? Nov 17 '20 at 17:53
  • The filetype is qf Nov 17 '20 at 18:07
  • 1
    @LucHermitte Exactly what I was looking for. Thank you! Nov 17 '20 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
    Nov 17 '20 at 20:52
0

@LucHermitte provided the answer I was looking for.

Quickcheck has a filetype = qf.

Thank you!

-E

1
  • 1
    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
    Nov 17 '20 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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