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

68810RE: Suggestion: Highlight the search pattern in :g/.../# or :g/.../p

Expand Messages
  • Choi, Jin-yong
    Mar 22, 2013
    • 0 Attachment
      On March 21, 2013 6:52 PM, Axel Bender wrote:

      > How about implementing a highlighting of the pattern searched for in
      > expressions? At times the resulting list is quite long and it is difficult
      > identify the pattern. Highlighting it would be of great benefit (at least
      > me...).

      First of all, I apologize for violating the "mailing rule."
      I think my previous e-mail is somehow strange-looking unlike others'. But I
      didn't recognize the problem. Sorry for the confusion.

      I want to suggest to use ':grep' for searching the text and highlighting
      Maybe ':grep' is not in your interest. But it could make something more
      convenient cause we can get the result in Quickfix list.

      Here is the code. Tested only on Windows platform and vim version is
      currently 7.3.875.

      function! Grep(pattern)
      exe 'grep ' . a:pattern
      let @/ = substitute(a:pattern, '/\(.*\)/.*$', '\1', '')
      command! -nargs=+ Grep call Grep(<q-args>) | set hls

      cnoreabbrev grep

      for Eatchar(), :helpgrep Eatchar

      You received this message from the "vim_dev" 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

      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 13 messages in this topic