1

long line

my .vimrc setting for wrapping line:

set nowrap " Don't auto wrap on load
set fo-=t " Don't wrap text when type
"set colorcolumn= 80
2
  • 1
    set wrap and set textwidth=80 should do it. You can control Vim wrapping pretty precisely see :h 'wrap', :h 'textwidth' and have a look at :h 'linebreak'
    – statox
    Dec 23, 2017 at 18:55
  • 1
    And of course gq to format long lines according to your textwidth setting
    – D. Ben Knoble
    Dec 25, 2017 at 14:45

1 Answer 1

1

Use :set tw=80. Also make sure you are not in “paste” mode. (https://stackoverflow.com/a/1272371/4752883)

If you need visual guidance on where you are with respect to 80 characters you can use :set colorcolumn = 80 (https://vi.stackexchange.com/a/576/13848)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.