问题
When executing a :make
command that displays its content in a temporary vim buffer, is there any way to have these lines soft-wrapped at the edge of the terminal? Most console hosts do not have side scrolling and any long lines that come out of :make
are completely truncated in vim (i.e. expanding the terminal width after-the-fact does not recover them).
I'm not able to interact with the buffer containing the :make
results in any meaningful way (:set wrap
or zl
) that would allow me to retrieve those contents, though I am sure a way exists.
I'm afraid my google fu has completely failed me on this one due to the exceptional number of wholly unrelated issues involve automatic wrapping of text, commit logs, and buffer content in vim.
回答1:
What you see is not the output of :make
, it is the output of the command executed by :make
in your shell. The way it is formatted is completely outside of Vim's influence and responsibility.
回答2:
The window is calld quickfix window and the docs says: "In the quickfix window, each line is one error." So it seems the absent of wrapping is a feature.
You can try to add BufReadPost
or BufWinEnter
events to change options in the window:
au BufReadPost quickfix setlocal wrap
but I'm not sure vim allows that.
来源:https://stackoverflow.com/questions/45129813/vim-wrap-long-make-lines-in-message-dialog