How do I search for a text string that spans multiple lines?

You can search for a text string that spans multiple lines using the \_x regular expression atom. For example, to search for the text string “Hello World”, you can use the following search command:

    /Hello\_sWorld

This will match the word “Hello” followed by a newline character and then the word “World” at the beginning of the next line. This will also match the word “Hello” immediately followed by a space character and then the word “World”. When searching for the “Hello World” string, to include the space characters at the end and beginning of the line, you can use the following search command:

    /Hello\_s\+World

Comments (1)


Pepsh Pepshinsky

Let’s see you to :help viminfo-file-name (option -i) :set viminfofile=NONE


Speak Your Mind