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

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

Expand Messages
  • Choi, Jin-yong
    ... to ... for ... First of all, I apologize for violating the mailing rule. I think my previous e-mail is somehow strange-looking unlike others . But I
    Message 1 of 13 , 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
      :g/.../
      > expressions? At times the resulting list is quite long and it is difficult
      to
      > identify the pattern. Highlighting it would be of great benefit (at least
      for
      > 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
      them.
      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', '')
      copen
      endfunction
      command! -nargs=+ Grep call Grep(<q-args>) | set hls

      cnoreabbrev grep
      Grep<Space>//<Space>%<C-Left><C-Left><Right><C-r>=Eatchar('\s')<CR>


      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.
    Your message has been successfully submitted and would be delivered to recipients shortly.