René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Find near (vim)

This function finds two words that are near each other.
fu! FindNear(a1, a2)
  let m = '\(\(\n\@<=\n\)\@<!\_.\)\{-}'

  let s = a:a1 . m . a:a2 . '\|' . a:a2 . m . a:a1

  execute "silent! normal /" . s . nr2char(13)
  let @/ = s
endfu