On Thu, Feb 24, 2011 at 10:49:29AM +0100, Ulf Magnusson wrote: > One problem with searching for phrases in files that contain wrapped > text (LaTeX source files, e-mails, source code comments, etc.) is that > you never know whether two words will be separated by a space or a > newline. Therefore, it would be handy to have an option that makes > spaces match newlines in searches.
This idea was brought up a few years ago in response to a Debian bug[0] and was not accepted. It was then reposed to this list a year or so later[1] and recieved no response. > I've looked at http://vim.wikia.com/wiki/Search_across_multiple_lines, > but those solutions have the disadvantage of either forcing you to use > an awkward pattern or not supporting incremental searching. That looks quite similar to the script Stefano ended up writing, except a bit cleaner since it's taking advantage of 7.0 features and simpler by not providing the ability to customize the separator. > A solution to a more general class of problems would be to allow the > search pattern to be automatically rewritten (e.g. by a substitution > or a function) prior to being used. That way you could automatically > rewrite spaces to \_s or do other neat things like having "foo bar" > match "foo {\it bar}" in LaTeX documents. Something like this could probably be done with expr cmaps, but you'd need to be able to restrict them to only run for / not : command lines. [0]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256743#12 [1]: http://thread.gmane.org/gmane.editors.vim.devel/11964 -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <james...@jamessan.com>
signature.asc
Description: Digital signature