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
  • 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 '17 at 18:55
  • 1
    And of course gq to format long lines according to your textwidth setting – D. Ben Knoble Dec 25 '17 at 14:45
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, privacy policy and cookie policy

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