aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/searchop.vim
blob: a7952341cf8d41acbe0fd63337c00d6fdc64de32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
nnoremap <silent> z/ :set opfunc=Search<CR>g@
vnoremap <silent> z/ :<C-u>call Search(visualmode(), 1)<CR>


function! Search(type, ...)
	let user_unnamed_register = @@

	silent execute "normal! `[v`]y"

	let @/ = escape(@@, '\')
	call histadd('/', @/)

	call feedkeys('n', 't')

	let @@ = user_unnamed_register
endfunction