Advertisement
Guest User

MIchael

a guest
Aug 17th, 2009
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. " * and # search for next/previous of selected text when used in visual mode
  2. xno * :<c-u>cal<SID>VisualSearch()<cr>/<cr>
  3. xno # :<c-u>cal<SID>VisualSearch()<cr>?<cr>
  4.  
  5. fun! s:VisualSearch()
  6. let old = @" | norm! gvy
  7. let @/ = '\V'.substitute(escape(@", '\'), '\n', '\\n', 'g')
  8. let @" = old
  9. endf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement