On 01/15/12 13:49, Steve Litt wrote:
On Sunday, January 15, 2012 10:39:42 AM Pau wrote:
thanks a lot... but I forgot to mention that one main
problem is that I cannot know in advance where the new line
is... isn't there a faster way of telling vim to ingore new
lines? thanks a lot!

Yes.

I don't know how to do it, but you could write a Vim-Language
function which first replaces all spaces in the search pattern
with \_, and then performs the search.

The following one-line mapping converts whatever you existing search is, into one that allows whitespace to cross lines:

:nnoremap <f4> :let @/=substitute(@/, '<bslash>s', '<bslash><bslash>_s<bslash><bslash>+', 'g')<cr>n


So you can search for something and then, if you get no hits, press <f4> and it will search again for the same thing allowing the spaces to be newlines instead.

-tim




--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to