Vim Script with Ranges
- Range search:
function! Range_Search(mypat, start_line, end_line) let full_pat = '\%>' . a:start_line . "l" . '\%<' . a:end_line . "l" . a:mypat exe '/' . full_pat let @/ = full_pat norm n endfunction command -range -nargs=1 Rs call Range_Search(<f-args>,<line1>,<line2>)