Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Word wrap in Gvim

Tags:

vim

word-wrap

How do I make Gvim word wrap in such a way that doesn't break words in the middle?

like image 718
Epsilon Vector Avatar asked Apr 13 '09 14:04

Epsilon Vector


People also ask

How do you wrap text in Gvim?

You can use "[movement]gq" to re-wrap some text.

How do I turn on word wrap in Vim?

Command to toggle word wrap in Vim While :set wrap will turn on word wrap in Vim and :set nowrap will turn off word wrapping, you can also use both commands with the ! (bang) symbol to toggle word wrap.

What is Nowrap in Vim?

Answer: To get Vim to not wrap text, issue the "vim set nowrap" command, like this: :set nowrap. By default vim will wrap long lines in the editor, but this command changes that display, so long lines will now go off-screen to your right.

How do I unwrap text in Vim?

It is better to use the :normal command with ! -specifier in this case to avoid clashes with custom mappings. – ib.


2 Answers

Looks like there is a solution online after all.

:set formatoptions=l :set lbr 

Link: http://vim.wikia.com/wiki/Word_wrap_without_line_breaks

like image 161
Epsilon Vector Avatar answered Oct 03 '22 14:10

Epsilon Vector


You can

:set nowrap  

to just let huge lines scroll of the edge of your screen. But tw is probably the better way to go.

like image 41
Vlad Dogaru Avatar answered Oct 03 '22 12:10

Vlad Dogaru