Loading ...
Sorry, an error occurred while loading the content.

Solved :match by visual

Expand Messages
  • Bee
    This is what I was looking for: hi User1 NONE ctermbg=green function! Visual2Highlight() let @/ = substitute(escape(@ , / ), n , n , g ) execute 2match
    Message 1 of 4 , Jul 28 8:06 AM
    • 0 Attachment
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.