diff options
-rw-r--r-- | plugin/searchop.vim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin/searchop.vim b/plugin/searchop.vim index 8a24ede..a795234 100644 --- a/plugin/searchop.vim +++ b/plugin/searchop.vim @@ -3,10 +3,14 @@ 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 |