Word wrap in Gvim

好久不见. 提交于 2019-11-28 16:40:03

问题


How do I make Gvim word wrap in such a way that doesn't break words in the middle?


回答1:


Looks like there is a solution online after all.

:set formatoptions=l
:set lbr

Link: http://vim.wikia.com/wiki/Word_wrap_without_line_breaks




回答2:


You can

:set nowrap 

to just let huge lines scroll of the edge of your screen. But tw is probably the better way to go.




回答3:


you can

:set wrap linebreak nolist



回答4:


:set tw=78

sets the text width to 78 characters. You can use "[movement]gq" to re-wrap some text.




回答5:


I use the following settings to wrap long lines for things like markdown files.

:set wrap
:set linebreak
:set nolist  " list disables linebreak
:set textwidth=0
:set wrapmargin=0

Source: http://vim.wikia.com/wiki/Word_wrap_without_line_breaks




回答6:


You can also use wrapmargin, which the manual defines as:

Number of characters from the right window border where wrapping
starts.  When typing text beyond this limit, an <EOL> will be inserted
and inserting continues on the next line.


来源:https://stackoverflow.com/questions/744159/word-wrap-in-gvim

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