How can I get vim find to ignore whitespace?

vim

Solution

In vim search, `_s` means a new line, a space or a tab. So you can try something such as:

/something on one\_s*line

to match the example string you used as example.

Problem

I have XML entries that span two or more lines sometimes, and so I can look for something like this: ``` something on one line ``` But if I try the vim command `/something on one line` and the line is like this: ``` something on one line ``` then it doesn't find it, because the second text block is actually seen as ``` something on one^J line ``` Which might have something to do with the fact that I'm using a DOS formatted file. How can I get vim search to ignore whitespace and newlines?

Original source

Related problems