Created
January 2, 2020 16:16
-
-
Save sooop/c956a2f37e2f0ab5de8a9965f4711812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" using `<Plug>` map | |
mes clear | |
let s:save_cpo = &cpo | |
set cpo&vim | |
function! s:highlightSelection() | |
let l:temp = @@ | |
normal! gvy | |
let @/ = '\V'. substitute(escape(@@, '\'), "\n", '\n', 'g') | |
let @@ = l:temp | |
endfunction | |
noremap <script> <Plug>ScmHighlight :<C-u>call <SID>highlightSelection()<CR> | |
vmap <leader># <Plug>ScmHighlight | |
let &cpo = s:save_cpo | |
unlet s:save_cpo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment