Describe question_pattern function! s:add_line(str) put! =a:str endfunction function! s:add_lines(lines) for line in reverse(deepcopy(a:lines)) put! =line endfor endfunction function! s:get_pos_char() return getline('.')[col('.')-1] endfunction function! s:reset_buffer() :1,$ delete let s:lines = ['1pattern_?', '2pattern_??', '3?pattern_c'] call s:add_lines(s:lines) normal! Gddgg0zt endfunction Before all let PowerAssert = powerassert#import() execute PowerAssert.define('PowerAssert') let s:assert = PowerAssert.assert map / (incsearch-forward) map ? (incsearch-backward) map g/ (incsearch-stay) call s:reset_buffer() End Before each :1 normal! zt End Describe search register @/ It @/ should be ? with `?\?` :$ exec "normal" "?\\?\" PowerAssert @/ is# '?' End It @/ should be \/ with `/\/` exec "normal" "/\\/\" PowerAssert @/ is# '\/' End End End