How do I enable word wrap in all open splits?

6

I am using vimdiff to compare three files side by side. How do I enable word wrap inside all three splits without having to switch to each and issue :set wrap three times? I would rather not have word wrap enabled by default though.

mike

Posted 2011-07-06T21:23:43.547

Reputation: 61

To clarify, you are looking to have a command apply to multiple buffers without setting it as the default? – viking – 2011-07-06T21:27:53.523

Yes, that's right. – mike – 2011-07-06T21:34:57.703

I think I found the answer: :windo. – mike – 2011-07-06T21:43:23.530

@mike: That's the answer I was going to post, but I suggest you post it so you can get the karma. – Heptite – 2011-07-06T23:09:05.250

Answers

8

:windo set wrap

Just answer it , got the hint from the comments.

Vihaan Verma

Posted 2011-07-06T21:23:43.547

Reputation: 329

For the sake of the argument, here is how to disable it too: :windo set nowrap also to set it only one of the window panes (Ctrl+W to switch panes) :set wrap – MediaVince – 2017-01-30T11:08:20.053

1Also, you can toggle the setting with :windo set wrap! and :set wrap! . (Convenient to map a keystroke to that to toggle the setting). – William Pursell – 2019-05-31T16:25:11.087