Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " * and # search for next/previous of selected text when used in visual mode
- xno * :<c-u>cal<SID>VisualSearch()<cr>/<cr>
- xno # :<c-u>cal<SID>VisualSearch()<cr>?<cr>
- fun! s:VisualSearch()
- let old = @" | norm! gvy
- let @/ = '\V'.substitute(escape(@", '\'), '\n', '\\n', 'g')
- let @" = old
- endf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement