Word wrap in Gvim

前端 未结 6 1551
北恋
北恋 2020-12-23 11:15

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

相关标签:
6条回答
  • 2020-12-23 11:57

    you can

    :set wrap linebreak nolist
    
    0 讨论(0)
  • 2020-12-23 12:00
    :set tw=78
    

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

    0 讨论(0)
  • 2020-12-23 12:03

    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.
    
    0 讨论(0)
  • 2020-12-23 12:10

    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

    0 讨论(0)
  • 2020-12-23 12:15

    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.

    0 讨论(0)
  • 2020-12-23 12:15

    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

    0 讨论(0)
提交回复
热议问题