I have an xml file with some text which is so long, that it does not fit into the normal line of my editor.
Is there an xml-specific way to insert a newline just for formatting, i.e. ignored by a correct xml parser?
Thank you in advance.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
You're looking for
This option changes how text is displayed. It doesn't change the text in the buffer, see 'textwidth' for that.
When on, lines longer than the width of the window will wrap and displaying continues on the next line. When off lines will not wrap and only part of long lines will be displayed. When the cursor is moved to a part that is not shown, the screen will scroll horizontally.
Simply add this line to your vimrc:
Or to use wrap only on xml buffers:
autocommand FileType xml setlocal wrap