How do I prevent long lines from wrapping on screen?
Answer
:set nowrap
Explanation
The nowrap option prevents long lines from wrapping to the next screen line. Instead, the line extends beyond the visible area and you scroll horizontally.
How it works
:set nowrapdisables visual line wrapping:set wrapre-enables wrapping- Long lines are cut off at the window edge
Example
With nowrap, a 200-character line shows only what fits in the window width. The rest is hidden until you scroll right.
Tips
zlandzhscroll horizontally one characterzLandzHscroll half a screen width:set sidescroll=1makes horizontal scrolling smooth:set linebreakwraps at word boundaries whenwrapis on- Use
gj/gkto navigate wrapped lines when wrap is on