3

I think everyone knows that vim can't display multiline messages in quickfix (yes, I know that it can parse them and show them as one big line). I thought about ways to workaround this and thought what if vim can wrap lines at arbitrary characters, I know it can wrap lines that are longer than number current screen. Maybe it can be done with arbitrary lines? If it would be so I could insert some characters instead of newlines in multiline messages so that vim would break lines at this characters.

1 Answer 1

1

The linebreak option instructs vim to wrap at the characters specified in the breakat option (by default spaces and a handful of punctuation characters). You can choose some "harmless" control character. For example, ^Y or control+Y

set wrap linebreak
exe "set breakat=\<c-y>"

will turn

I think everyone knows that vim can't display^Ymultiline messages in quickfix

(visually) into

I think everyone knows that vim can't display^Y
multiline messages in quickfix

This introduces the problem that <c-y> is visible as ^Y. For this you could use vim's conceal feature.

syn match QFBreak /\%o31/ conceal cchar=↲
set cole=2

To completely hide the character, use set cole=3 instead.

3
  • 1
    This will only break if the line isn't fitted on the screen. I'm talking about breaking it even if it fits the screen. Commented Aug 28, 2017 at 21:26
  • Ah, okay. I don't know personally, but hopefully someone else has a solution.
    – Mass
    Commented Aug 29, 2017 at 1:06
  • I don't have high hopes on that. Since this would be a nice workaround for multiline quickfix problem and I never heard of it. Commented Aug 29, 2017 at 10:07

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.