0

How to stop VIM from breaking lines after a few words

I’ve just installed gvim, the windows version of VIM (the so famous text editor every *nix user/admin should be comfortable with). I’ve always had inclination for this editor, but it’s not been possible for me to use it on a daily basis.

Yesterday, while getting real starting a web project, I decided it was the time to give vim another chance. It turned out again, that vim is not a very user-friendly editor, but remember, it’s SO powerful that if you mastered it, it could almost code for you. Or at least, that’s what people say…

Nevertheless, vim being complicated was not the problem, it was vim breaking lines after I had written a few words! It was unusable. After a too long search (for a real project) I’ve managed to find what was wrong in my settings. It turned out that the option “text width” (tw) was set to 8! Then, after writing 8 characters, the next word you’d write would break the line. Just unbearable.

The solution: Turning off text width by setting tw to zero. So you have to edit your .vimrc going to “Edit -> Startup Settings” and add the following line:

set tw=0