0

I'm not sure why this started to happen but recently vim seems to have begun autowrapping lines when in insert mode. It's pretty annoying.

I use the following modules

'vim-ruby/vim-ruby'
'rodjek/vim-puppet'
'romainl/Apprentice'
'plasticboy/vim-markdown'

I also have the following set

set wildmode=longest,full
set textwidth=80
set autoindent

It pretty much happens in all files so filetype seems to not matter. The full vimrc can be seen here https://pastebin.com/1kpUmXFd

4
  • 2
    Does this answer your question? Adding new characters cause splitting line into many lines Sep 25, 2020 at 22:25
  • 1
    Welcome to Vi and Vim, Biff! You can usually work around that by setting :set tw=0. But usually Vim will wrap lines depending on the file type you're editing. Can you take a look and share what file type you're editing when this happens? Also post the result of :set ft? and :set fo?, since the former can confirm the file type and the latter is involved in the decisions on when to wrap long lines after the 'textwidth' is reached...
    – filbranden
    Sep 25, 2020 at 22:44
  • Well the tw being set to 80 like I have has been set for decades now without issue. It's only recently upon entering insert mode or writing text that the wrapping happens. It's every ft. The fo is formatoptions=croql
    – Biff
    Sep 26, 2020 at 1:12
  • If you have fo=croql, then it means only comments will be broken at 'textwidth'. Is it possible that what you're seeing is only happening on lines that have comments? If you remove the c from that option (:set fo-=c), then Vim should stop breaking lines at tw when those lines are comments...
    – filbranden
    Sep 26, 2020 at 6:14

1 Answer 1

1

Remove the tw=79 and textwidth=80 from you .vimrc and Vim will not wrap lines.

1
  • 2
    This would be a stronger answer if it included an explanation: why do these steps solve the problem? In the comments, OP mentions they've had these settings for a while, and only recently has the problem emerged
    – D. Ben Knoble
    Sep 27, 2020 at 14:43

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.