Skip to content

Instantly share code, notes, and snippets.

@scrooloose
Created July 15, 2010 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save scrooloose/477606 to your computer and use it in GitHub Desktop.
Save scrooloose/477606 to your computer and use it in GitHub Desktop.
"visual search mappings
function! s:VSetSearch()
let temp = @@
norm! gvy
let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
let @@ = temp
endfunction
vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR>
vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment