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


function! Search(type, ...)
	silent execute "normal! `[v`]y"

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

	call feedkeys('n', 't')
endfunction