Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use @s register instead @@

- @* gets changed otherwise
  • Loading branch information...
commit 15abfaa83f76be989fbe9ce3a31284f7ecacd98a 1 parent ab4e844
@gmarik gmarik authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 plugin/visual-star-search.vim
View
8 plugin/visual-star-search.vim
@@ -2,10 +2,10 @@
" makes * and # work on visual mode too.
function! s:VSetSearch()
- let temp = @@
- norm! gvy
- let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
- let @@ = temp
+ let temp = @s
+ norm! gv"sy
+ let @/ = '\V' . substitute(escape(@s, '\'), '\n', '\\n', 'g')
+ let @s = temp
endfunction
vmap * :<C-u>call <SID>VSetSearch()<CR>//<CR>
Please sign in to comment.
Something went wrong with that request. Please try again.