Saturday, July 28, 2012

Solved :match by visual

This is what I was looking for:

hi User1 NONE ctermbg=green

function! Visual2Highlight()
let @/ = substitute(escape(@",'/\'),'\n','\\n','g')
execute '2match User1 /\c\V'. @/ . '/'
endf

vnoremap <F12> y:call Visual2Highlight()<cr>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment