# textwidth in vim, mutt - different behaviours



## mdl90 (Mar 31, 2016)

Vim doesn't seem to apply `textwidth` instruction as expected (instead, the line just runs on to the end of the terminal window - so apparently applies no EOL/carriage return). I have confirmed that on start Vim reads ~/.vimrc (line numbers and other settings operate as configured in this file).

Conversely, Mutt (which has Vim set as editor) applies `textwidth` variable just as expected.

I want Vim to do this as well, but can't see why it is not doing so.


----------



## aragats (Mar 31, 2016)

Did you check muttrc for `editor` variable? For example, I use a different vimrc for mutt(1).
Certainly there is a setting which resets your `textwidth`, search for the abbreviated version `tw`, or maybe you have a plugin which resets it.


----------



## SirDice (Mar 31, 2016)

It's possibly also the difference between wrap and nowrap. The latter will continue the line even if it's wider than can be shown.


----------



## mdl90 (Mar 31, 2016)

SirDice said:


> It's possibly also the difference between wrap and nowrap. The latter will continue the line even if it's wider than can be shown.



Yes, that seems to be it. My initial 'test' just ran the same character across the screen (so, a faulty diagnosis on my part). Now I see that as soon as I enter a whitespace character, this results in the line break being introduced, just as I expect. More here:

http://vim.wikia.com/wiki/Automatic_word_wrapping


----------

