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
Autocommands to the rescue!
Put these lines in your vimrc
:
augroup quickfix
autocmd!
autocmd FileType qf setlocal wrap
augroup END
There's also this slightly cleaner method:
- create
~/.vim/after/ftplugin/qf.vim
, 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!– JankoApr 7, 2015 at 19:24