Vim: wrap long :make lines in message dialog?

て烟熏妆下的殇ゞ 提交于 2021-02-19 06:23:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!