4

I think this should be a quick answer, but I can't figure it out from :help location-list and my Google searches seem to highlight that I may not know the correct terms to look for.

For the sake of this scenario, lets say I'm using syntastic to run hlint on a Haskell file, and it's adding things to the location-list.

In my .vimrc, I have set nowrap on (that's the way I like it) but I am imagining that since the location-list is a separate pane that I could probably target it with something akin to autocmd [???] location-list set wrap.

Is there a way? (I would especially appreciate a link to the docs about this because I think that might help me grok stuff inthe future.)

9

You can indeed use an autocommand:

augroup MyStuff
  autocmd!
  autocmd FileType qf setlocal wrap
augroup END

This will affect the quickfix window, too, but I presume that would be desirable.

You can find a sort of oblique reference to this in the documentation by opening :help location-list and then searching for filetype.

Even better, use Vim's after directory. Create a file:

.vim/after/ftplugin/qf.vim

With the contents:

setlocal wrap

This is documented in :help after-directory and, perhaps more relevantly, in :help ftplugin-overrule.

  • 1
    :chef-kiss: perfect! – Jon Bristow Mar 27 '18 at 16:42
  • Whoops, forgot to select as answer. I have since rectified the situation. – Jon Bristow Jun 1 '18 at 23:01

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.