I'm using Dispatch.vim, and often when there's a test error, some lines in the quickfix list are really long. I don't use soft wrapping for my code, so quickfix also isn't wrapped. Is it possible to automatically setlocal wrap only for the quickfix window?

1 Answer 1


Autocommands to the rescue!

Put these lines in your vimrc:

augroup quickfix
    autocmd FileType qf setlocal wrap
augroup END

There's also this slightly cleaner method:

  1. create ~/.vim/after/ftplugin/qf.vim,
  2. and put this line in it:

    setlocal wrap

The first method adds yet another autocommand to the possibly large pile of autocommands already in your config.

The second method takes advantage of the fact that Vim already runs its own set of autocommands to determine filetype and source the appropriate ftplugins.

  • Perfect! I didn't know that quickfix list has it's own filetype. Thank you!
    – Janko
    Commented Apr 7, 2015 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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