I do a vimdiff on 2 files. Now if I want to wrap 2 files then I need to apply :set wrap
2 times to each file separately.
Is there any way I can apply set wrap
to both of them simultaneously without running same command twice?
You can open multiple files at the start of the Vim editing session from the command line, or at any time from inside the Vim editing session.
There are two ways to use the Vim setting options: 1. Enable the options for an individual file inside the Vim session using :set Open the desired file in Vim, type any option using the :set command in the Normal mode, and press Enter.
Using windows. Ctrl-W w to switch between open windows, and Ctrl-W h (or j or k or l ) to navigate through open windows. Ctrl-W c to close the current window, and Ctrl-W o to close all windows except the current one. Starting vim with a -o or -O flag opens each file in its own split.
A buffer is an area of Vim's memory used to hold text read from a file. In addition, an empty buffer with no associated file can be created to allow the entry of text. The :e filename command can edit an existing file or a new file.
windo does exactly what you want:
:windo set wrap
If you have multiple tabs, there is an equivalent tabdo
to handle that case.
:tabdo set wrap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With