How to stop line breaking in vim

vim
Haiyuan Zhang picture Haiyuan Zhang · Feb 17, 2010 · Viewed 164.1k times · Source

I like that the long lines are displayed over more than one terminal line; I don’t like that vim inserts newlines into my actual text. Which part of .vimrc I should change?

Answer

Brian Rasmussen picture Brian Rasmussen · Feb 17, 2010

Use

:set wrap

To wrap lines visually, i.e. the line is still one line of text, but Vim displays it on multiple lines.

Use

:set nowrap

To display long lines as just one line (i.e. you have to scroll horizontally to see the entire line).